Skip to content

Instantly share code, notes, and snippets.

@godismyjudge95
Last active September 17, 2025 15:14
Show Gist options
  • Select an option

  • Save godismyjudge95/bdab9a60850a93af1602f228a37f895d to your computer and use it in GitHub Desktop.

Select an option

Save godismyjudge95/bdab9a60850a93af1602f228a37f895d to your computer and use it in GitHub Desktop.
Extend migrate command
<?php
namespace App\Providers;
use App\Console\Commands\Migrate;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void {}
public function boot(): void
{
$this->app->singleton(Migrate::class, function ($app) {
return new Migrate($app['migrator'], $app[Dispatcher::class]);
});
}
}
<?php
namespace App\Console\Commands;
use Illuminate\Database\Console\Migrations\MigrateCommand;
class Migrate extends MigrateCommand
{
public function handle()
{
echo 'test';
exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment