laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.32k stars 130 forks source link

Add migrate:install to white listed commands #136

Closed michaelhume closed 2 years ago

michaelhume commented 2 years ago

Hi,

Since the migrate command depends on migrate:install in order to prepare the database when first run, if running code that executes a call to migrate within tinker (on a fresh db) a Symfony/Component/Console/Exception/NamespaceNotFoundException with message 'There are no commands defined in the "migrate" namespace.' is the result.

Adding migrate:install to the whitelisted commands resolves this.

N.B. Adding \Illuminate\Database\Console\Migrations\InstallCommand::class to config/tinker.php results in a BindingResolutionException: Target [Illuminate\Database\Migrations\MigrationRepositoryInterface] is not instantiable while building [Illuminate\Database\Console\Migrations\InstallCommand].

Thanks for all you do!

driesvints commented 2 years ago

I don't think this belongs in that list but you can always attempt a pr to see if Taylor would accept it. Thanks