jeudi 21 novembre 2019

Laravel - Catch php artisan commands

I've did some changes in my config/app to use multiple databases selected by front-end, now I have to tell in \Request()->header('database') which database I want access.

It's work perfectly, the problem is: when I try to do any artisan commands my logic dies, because isn't informed the database.

So I need to inform the database in artisan commands, like that:

php artisan migrate --database=sandiego_school
php artisan migrate:rollback --database=newyork_school 

How can I observer all commands to get the argument?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire