I cannot find info for redirecting as 301/302 in the Laravel docs.
In my routes.php file I use:
Route::get(\'foo\', function(){
return Redirect::to(
As of Laravel 5.8 you can specify Route::redirect
:
Route::redirect('/here', '/there');
By default that will redirect with 302 HTTP status code, meaning temporary redirect. If the page is permanently moved you can specify 301 HTTP status code:
Route::permanentRedirect('/here', '/there');
/* OR */
Route::redirect('/here', '/there', 301);
Laravel docs: https://laravel.com/docs/5.8/routing#redirect-routes