我有多个数据库,每个数据库的迁移存储在不同的文件夹中。因此,我希望覆盖migrate:rollback命令并为文件夹添加一个选项,而不是每次都指定路径。
migrate:rollback
php artisan migrate:rollback --path=/database/migrations/{{folder}}
php artisan migrate:rollback {{folder}}我如何才能做到这一点?
php artisan migrate:rollback {{folder}}
rt4zxlrg1#
protected $signature = 'test {folder}'; protected $description = 'Testing Purpose'; public function handle() { $this->ask('Enter Folder Name?'); $folder = $this->argument('folder'); $command = "migrate:rollback --path=/database/migrations/{$folder}"; Artisan::call($command); }
1条答案
按热度按时间rt4zxlrg1#