2016-01-25 31 views

回答

3

我发现这是最好的方法:

(new RedirectResponse('/URL-HERE'))->send();   // 302 temporary 
(new RedirectResponse('/URL-HERE', 301))->send();  // 301 permanent 

您应该能够从应用程序内(几乎)任何地方调用这个,而不是担心命名空间,因为它在/concrete/config/app.php的别名。

2

另一解决方案是如下:

$response = \Redirect::to('/URL-HERE'); 
$response->send(); 
exit; 

return \Redirect::to('/URL-HERE')->send(); 

旁注:提供的URL必须不绝对的。例如:'/dashboard/reports/logs'