Laravel-重定向到页面并滚动到页面底部


Laravel - redirect to page and scroll to the bottom of the page

>我使用 Laravel 框架,在我的控制器中我有

return Redirect::route('home'); 

正在重定向到主页。但我想完成页面向下滚动以在重定向时查看页脚。像href="home#footer"有办法吗?

您可以为路由生成 URL,然后附加哈希并重定向到该 URL

$url = URL::route('home') . '#footer';
return Redirect::to($url);