我会这样做的
如果您的表格是(2个按钮):
{{ Form::open(array('url' => 'test/auth')) }}
{{ Form::email('email') }}
{{ Form::password('password') }}
{{ Form::password('confirm_password') }}
{{ Form::close() }}
创建一个控制器’TestController’
添加路线
Route::post('test/auth', array('uses' => 'TestController@postAuth'));
在TestController中,您有一个方法可以检查单击了哪个提交以及另外两个登录和注册方法
class TestController extends BaseController {
public function postAuth()
{
//check which submit was clicked on
if(Input::get('login')) {
$this->postLogin(); //if login then use this method
} elseif(Input::get('register')) {
$this->postRegister(); //if register then use this method
}
}
public function postLogin()
{
echo "We're logging in";
//process your input here Input:get('email') etc.
}
public function postRegister()
{
echo "We're registering";
//process your input here Input:get('email') etc.
}
}
?>