spatie / laravel-missing-page-redirector

Redirect missing pages in your Laravel application
https://freek.dev/598-retain-your-seo-worth-by-correctly-redirecting-missing-pages-in-a-laravel-application
MIT License
488 stars 38 forks source link

how can I catch unhandled redirects? #39

Closed vesper8 closed 6 years ago

vesper8 commented 6 years ago

in my exception handler I have a line that logs every 404. Right now it's logging every 404 including all the 404s that are then properly handled and redirected with this package.

I would like to only log the unhandled redirects.. the ones that don't match a rule handled by this package.

Any chance you could give guidance on how to do that?

freekmurze commented 6 years ago

Right now handling that situation is indeed difficult.I'm thinking that we are fairly certain that a route wasn't found in the redirector router when we are in here.

I'd accept an event being fired there. In your code you could than act upon that event being fired.

Thoughts?

vesper8 commented 6 years ago

Thanks for the tip.. I like that idea.. I'll try it out

For the PR.. I'll try to but I know you like your PRs well tested and I have to say writing tests is not something I have much experience with as of yet.. kinda been avoiding that.. too busy writing code ;p