php - How to re-route a laravel call internally (without redirect)? -


in laravel, given url routed specific controller method. inside method, want return response if user has visited different route. can so:

return app::make('othercontroller')->othermethod(); 

however, depends on hardcoding class , method names want send them to. prefer, send them controller identified name of route, rather name of controller class. how can that?

one possibility return redirect::route($otherroute), except a) actual redirect, means adds page load time , replaces url see, , b) makes hard transfer post data. so, don't want that.

how can call controller, knowing name of route linked to?

as @mruf said, try:

return \route::dispatch(\request::create($otherroute, 'get'));  

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -