Closed netpok closed 1 month ago
Thank you for reporting this issue!
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Thank you!
I investigated a little bit the migrate --seed
command and it breaks because it tries to calls the migrate command class and internally it calls the db:seed
command which breaks because it's not on the whitelist of commands inside TinkerCommand
, i tried to add db
and db:seed
in the whitelist and it looks like it works.
I don't really know why they where not added in the first place, maybe @driesvints can explain it better.
I investigated a little bit the
migrate --seed
command and it breaks because it tries to calls the migrate command class and internally it calls thedb:seed
command which breaks because it's not on the whitelist of commands insideTinkerCommand
, i tried to adddb
anddb:seed
in the whitelist and it looks like it works.I don't really know why they where not added in the first place, maybe @driesvints can explain it better.
Same here I first published the tinker config file and added Illuminate\Database\Console\Seeds\SeedCommand::class
inside its commands array and Artisan::call('migrate --seed')
worked without nagging.
But the issue with down --quiet
is still unknow to me.
Ah there it is !
If we take a look at Illuminate\Foundation\Console\DownCommand
there is no --quiet option in there!
The --quiet option is added by Laravel itself.
Thanks @yoonustehrani. @netpok feel free to add the command to the config file if you need it in Tinker.
Tinker Version
2.9.0
Laravel Version
11.19.0
PHP Version
8.3.9
Database Driver & Version
MySQL 8.0.37 on Linux
Description
Artisan calls are not working as expected, two examples:
migrate --seed
results in errorNAMESPACE NOT FOUND There are no commands defined in the "db" namespace.
down --quiet
results inINVALID OPTION The "--quiet" option does not exist.
These commands are running successfully when called like
php artisan down --quiet
orphp artisan migrate --seed
.Also the same happens when they are indirectly called (e.g.
$model->restore()
is called in tinker and an event listener executes theArtisan::call('migrate --seed');
line.Steps To Reproduce
Take a brand new Laravel install and run
Artisan::call('migrate --seed')
orArtisan::call('down --quiet')
in tinker.