⬡ Lacelium
⌘K
Version 2.x ▾

Dipper Console

Introduction

The Dipper Console is the command-line interface included with Lacelium. It provides a helpful suite of commands that assist you while developing your application, running migrations, serving background workers, and scaffolding new classes.

To view a complete list of all available console commands, run the list command:

php console list

Built-in Commands

Lacelium includes dozens of pre-configured commands out of the box:

Development & Servers

# Start the local development web server
php console serve [--host=127.0.0.1] [--port=8000]

# Start the Nexify real-time daemon (shares same port as Lacelium)
php console nexify:serve

# Display application diagnostics and configuration
php console about

Generators (make:*)

# Generate a new Controller
php console make:controller UserController

# Generate a new Model
php console make:model Order

# Generate a database Migration
php console make:migration create_orders_table

# Generate a database Seeder
php console make:seeder UserSeeder

# Generate a custom Console Command
php console make:command SendWeeklyReports

Database & Migrations

# Run pending migrations
php console migrate

# Roll back the last migration batch
php console migrate:rollback

# Seed the database with records
php console db:seed

Command Allow List & Security

In high-security environments, or when exposing console execution via an administrative web interface (such as ArgusKit), Lacelium enforces an explicit command allow-list in config/console.php.

Only commands registered in the allow-list can be triggered through administrative web endpoints:

// config/console.php
return [
    'allow_list' => [
        'migrate',
        'cache:clear',
        'config:cache',
        'about',
    ],
    'disallow_production' => [
        'migrate:fresh',
        'db:wipe',
    ],
];

Creating Custom Commands

To create a new console command, use the make:command command:

php console make:command PruneExpiredTokens

This command will generate a new class in the app/Console/Commands directory:

<?php

declare(strict_types=1);

namespace App\Console\Commands;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class PruneExpiredTokens extends Command
{
    protected static $defaultName = 'tokens:prune';
    protected static $defaultDescription = 'Delete expired authentication tokens from the database';

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $output->writeln('<info>Pruning expired tokens...</info>');

        // Perform cleanup logic here
        // \App\Models\Token::where('expires_at', '<', now())->delete();

        $output->writeln('<info>Cleanup complete!</info>');
        return Command::SUCCESS;
    }
}

Registering Commands

All commands placed within app/Console/Commands that extend Symfony\Component\Console\Command\Command are automatically registered and discovered by the Dipper runner.

Next Steps