在我的控制器/动作中:
if(!empty($_POST))
{
if(Auth::attempt(Input::get('data')))
{
return Redirect::intended();
}
else
{
Session::flash('error_message','');
}
}
有没有方法在Laravel
检查请求是否是POST
or GET
?
根据Laravel 文档 http://laravel.com/docs/requests#request-information,有一个 Request 方法来检查它,所以你可以这样做:
$method = Request::method();
or
if (Request::isMethod('post'))
{
//
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)