Skip to content

Conversation

@davidrushton
Copy link
Contributor

The new Laravel 5.5 auto loading of console commands is great.

Unfortunately it didn't work in my app, as I use an abstract class that extends Illuminate\Console\Command, so the is_subclass_of($command, Command::class) was resolving that abstract class causing a Illuminate\Contracts\Container\BindingResolutionException exception.

This PR changes the conditional to use ReflectionClass and the isAbstract and isSubclassOf methods, fixing this issue.

PS. My abstract console class is extended by custom migration classes that are necessary for our multi-tenant / multi-database migrations, while the base migrator commands act on our primary database.

@davidrushton davidrushton changed the title Updated Console/Kernel autoloading of commands to ignore abstract classes [5.5] Updated Console/Kernel autoloading of commands to ignore abstract classes Sep 2, 2017
@taylorotwell taylorotwell merged commit fd9319f into laravel:5.5 Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants