On Laravel 4.2 I can extend Custom Request class (http://laravel.com/docs/4.2/extending#request-extension)
but on Laravel 5 I can't find how do that.
Application::requestClass method was gone.
I hope to find way that can extend custom request or custom router class
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.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community