Skip to content

Conversation

@jnoordsij
Copy link
Contributor

According to Laravel docs, registering routes should never happen within the register method, as only binding should happen there. In practice, this causes a problem when trying to override/extend the base Laravel FilesystemServiceProvider, which combined with registering this package triggers an Illuminate\Contracts\Container\BindingResolutionException with message Target class [files] does not exist..

Therefore, moving the registering of routes to the boot method looks like a more robust approach to me. See also the example from the Laravel docs on the loadRoutesFrom method.

@PrinsFrank
Copy link

This issue is also solved in #1252 by marking the serviceProvider deferrable.

@jnoordsij
Copy link
Contributor Author

@barryvdh any chance you have some time to check this? It should be a quick and clear fix I think.

@jnoordsij
Copy link
Contributor Author

Actually, I see #1197 already proposed this earlier. Closing this in favor of that, hoping it can be merged soon!

@jnoordsij jnoordsij closed this May 3, 2022
@jnoordsij jnoordsij deleted the defer-route-loading branch May 4, 2022 13:04
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