I don't know if this is the best solution, but it works.
First, make a new command (just copy/paste this). Use this to extend the original FreshCommand and give it the same signature.
/app/Console/Commands/RemoveMigrateFresh.php.
<?php
namespace App\Console\Commands;
use Illuminate\Database\Console\Migrations\FreshCommand as MigrateFreshCommand;
class RemoveMigrateFresh extends MigrateFreshCommand
{
protected $signature = 'migrate:fresh';
protected $description = 'This command has been disabled.';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$this->error('migrate:fresh has been disabled!');
}
}
Then, in app/Providers/AppServiceProvider, add this to the register() method.
public function register()
{
$this->app->singleton(
'Illuminate\Database\Console\Migrations\FreshCommand',
'App\Console\Commands\RemoveMigrateFresh'
);
}
The command will still be listed when you do php artisan, but have the new description
migrate:fresh This command has been disabled.
And when you execute php artisan migrate:fresh, it doesn't do anything (no tables dropped). All it does is output
migrate:fresh has been disabled!
Edit: crap, just realized this was in the Lumen section. I hope this works there too as I haven't tried in Lumen.