There’s only 3 steps required to setting up new Artisan command.
1. Step 1 – Create a new console file
php artisan make:console CommandName
2. Step 2 – Open up `app/Console/Commands/CommandName.php` and update the signature and the description property.
/** * The name and signature of the console command. * * @var string */ protected $signature = 'env:db'; /** * The console command description. * * @var string */ protected $description = 'Configure database settings';
3. Step 3 – Register your new Artisan command in `app/Console/Kernel.php`
/** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ // Commands\Inspire::class, Commands\DatabaseEnvironment::class ];
Now you’re ready with your new artisan command. Check your command with `php artisan`. It should have something like this one.