-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Description
- Laravel Version: 7.1.13
- PHP Version: 7.4.1
- Database Driver & Version: MySQL 8.0.18
Description:
Apologies if this is my misunderstanding rather than an error, but there's a weird issue when creating custom versions of certain migration commands, causing the container to throw a dependency error due to a failure to resolve $customStubPath for MigrationCreator:
Unresolvable dependency resolving [Parameter #1 [ <required> $customStubPath ]] in class Illuminate\Database\Migrations\MigrationCreator
I'm able to address the issue by adding the following to my AppServiceProvider, though I'm not sure if I'm missing a more appropriate way to handle this:
$this->app->when(MigrationCreator::class)
->needs('$customStubPath')
->give(function ($app) {
return $app->basePath('stubs');
});Since MigrationCreator is being registered in the MigrationServiceProvider, I'm thinking the resolution failure is an error and that the above snippet should not be necessary, though I'm not sure what's actually behind the failed resolution.
Steps To Reproduce:
- Create a custom (even if just empty)
app/Console/Commands/MigrateMakeCommand.phpextendingIlluminate\Database\Console\Migrations\MigrateMakeCommand - Run any Artisan command; this should be enough to trigger the error
guoliang1994, thiagobrauer and danbaddeley-symdistro
Metadata
Metadata
Assignees
Labels
No labels