diff --git a/routes/console.php b/routes/console.php index e05f4c9..079ee29 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,6 +1,6 @@ comment(Inspiring::quote()); -})->purpose('Display an inspiring quote'); +if (!App::isProduction()) { + /** + * Wipe, migrate, and seed the database. + */ + Artisan::command('dev:reset', function () { + /** @phpstan-ignore-next-line */ + assert($this instanceof ClosureCommand); + Artisan::call('db:wipe'); + $this->info(Artisan::output()); + Artisan::call('migrate'); + $this->info(Artisan::output()); + Artisan::call('db:seed'); + $this->info(Artisan::output()); + $this->info('Database reset complete!'); + })->purpose('Wipe, migrate, and seed the database.'); +}