我想通过名称获取路由值并将其存储在变量中。
原因是,我想使用 Redirect::intended($url) 方法将用户重定向到路由,而不是仅仅将 url 放在那里。
基本上,我希望具有与 Redirect::route($route_name) 相同的行为,但具有 intended() 函数。
有没有像 Route::getValueByName() 这样的方法?
非常感谢。
最佳答案
如果我没猜错,你可以使用
Redirect::intended(route('home'));
或
Redirect::intended('/');
甚至
Redirect::intended(action('BaseController@index'));
关于php - 在 Redirect::intended 中指定路由名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25170914/