As the container parameter is nullable in Illuminate\Routing\Router's constructor, an empty container is assigned in its constructor when no container is provided.
Since https://github.com/laravel/framework/pull/44339 introduced Illuminate/Routing/Contracts/CallableDispatcher, a router needs this interface bound to dispatch closure bound routes such as the ones registered here:
Passes Laravel Container to the Router constructor in this package's Service Provider, so it has a container which knows how to build a CallableDispatcher instance.
closes #77
As the container parameter is nullable in
Illuminate\Routing\Router
's constructor, an empty container is assigned in its constructor when no container is provided.Since https://github.com/laravel/framework/pull/44339 introduced
Illuminate/Routing/Contracts/CallableDispatcher
, a router needs this interface bound to dispatch closure bound routes such as the ones registered here:https://github.com/spatie/laravel-missing-page-redirector/blob/ba2bc5f2e9cf3be883c311c125c756903eae412d/src/MissingPageRouter.php#L42-L53
This PR
Router
constructor in this package's Service Provider, so it has a container which knows how to build aCallableDispatcher
instance.