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
Post a Comment