在我的 Controller / Action 中:
if(!empty($_POST))
{
if(Auth::attempt(Input::get('data')))
{
return Redirect::intended();
}
else
{
Session::flash('error_message','');
}
}
Laravel
中是否有方法来检查请求是POST
还是GET
?
最佳答案
根据 Laravels docs ,有一个 Request 方法来检查它,所以你可以这样做:
$method = Request::method();
或
if (Request::isMethod('post'))
{
//
}
关于php - 检查请求是 GET 还是 POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21064582/