* Get method
Route::get('index', 'UserController@login');
Route::get('register', 'UserController@register');
* Post method
Route::post('register_action', 'UserController@register', array('before' => 'csrf'));
* Post method and condition
Route::post('register_action', array('before' => 'csrf', function()
{
if(?? == ??) {
$obj = new UserController();
return $obj->register();
}
}));
Usercontroller.php
<?php
class UserController extends BaseController {
public function login() {
return 'login';
}
public function register() {
return 'regsiter';
}
}