Support the ongoing development of Laravel.io →
Requests IOC
Last updated 2 years ago.
0
Solution

I managed this with the RedirectResponse just by creating my classes that extend \Illuminate\Http\RedirectResponse and \Illuminate\Routing\Redirector then just registering that in my own service provider.

For the service provider I just copied how laravel done it in \Illuminate\Routing\RoutingServiceProvider@registerRedirector and dropped in my own classes where needed.

I suspect you can use a similar method to extend the Request and Route classes.

0

The request is first created in index.php. I haven't completely wrapped my head around how the class resolver works, so there could be a better way, but I was able to just change the class here.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

findstar findstar Joined 13 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.