How to Forward a Request to Another Controller in Laravel

If you have ever need to forward or call another controller from a controller in Laravel, here are two methods

This will redirect the request to another controller’s method.

return redirect()->action('AnotherController@method');

You can also call another method directly without doing a redirect

return app->call('App\Http\Controllers\AnotherController@method');

Hope one of these methods help!


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

2 thoughts to “How to Forward a Request to Another Controller in Laravel”

  1. Hello,
    The second solution is wrong:

    return app->call(‘App\Http\Controllers\AnotherController@method’);

    needs to be

    return app()->call(‘App\Http\Controllers\AnotherController@method’);

Leave a Reply

Your email address will not be published. Required fields are marked *