Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel v9.33.0 not working #77

Closed
it-can opened this issue Oct 1, 2022 · 4 comments · Fixed by #78
Closed

Laravel v9.33.0 not working #77

it-can opened this issue Oct 1, 2022 · 4 comments · Fixed by #78

Comments

@it-can
Copy link
Contributor

it-can commented Oct 1, 2022

Seems this package is not working with the latest Laravel 9.33.0, I think it has to do with this PR laravel/framework#44339

All tests seem to fail on the latest version, rolling back to laravel/framwork v9.32.0 and this package is working again...

@it-can
Copy link
Contributor Author

it-can commented Oct 1, 2022

As far as I can tell the "problem" is here:

https://github.com/spatie/laravel-missing-page-redirector/blob/main/src/MissingPageRouter.php#L42

it seems that $redirects is null on v9.33.0 (9.32 it is filled correctly)

@it-can
Copy link
Contributor Author

it-can commented Oct 1, 2022

Okay think I found the "problem"

laravel/framework@103ae1e#diff-efe2a07687b9b821bbd99ae38a9329253f032e6df04bdea02bba9303a2b2bead

if I revert those changes then this package works again...

@freekmurze
Copy link
Member

I'd accept a PR that fixes this (or if the bug is at Laravel, send a bug fix there 🙂)

@it-can
Copy link
Contributor Author

it-can commented Oct 1, 2022

I'd accept a PR that fixes this (or if the bug is at Laravel, send a bug fix there 🙂)

The changes recently made are too complex for me to completely understand…

otherwise I would definitly submit a pr

freekmurze pushed a commit that referenced this issue Oct 13, 2022
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 laravel/framework#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

- 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.
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 a pull request may close this issue.

2 participants