Skip to content

Instantly share code, notes, and snippets.

@ezura
Last active August 29, 2015 14:04
Show Gist options
  • Save ezura/71938efe290ef06a73ed to your computer and use it in GitHub Desktop.
Save ezura/71938efe290ef06a73ed to your computer and use it in GitHub Desktop.
<?php
/*
* If You want to prohibit that guest users display it,
* write in this group.
*/
Route::group(array('before' => 'auth'), function()
{
Route::get('/', array(
'uses' => 'MainController@index',
'as' => 'home'));
});
Route::get('login', array(
'uses' => 'SessionController@index',
'as' => 'session.new'));
Route::post('login', array(
'before' => 'csrf',
'uses' => 'SessionController@login',
'as' => 'session.create'
));
Route::get('logout', array(
'uses' => 'SessionController@logout',
'as' => 'session.destroy'
));
// manage user information
Route::get('signup/{type?}', array(
'uses' => 'UserController@index',
'as' => 'user.new'
));
Route::post('signup/{type?}', array(
'uses' => 'UserController@create',
'as' => 'user.create'
));
/* When GET http://hogehoge/hoge/{method}, you can call RegisterController.get{method}
* I don't know it is good practice in laravel..
* I think we should discuss coding rule.
*/
// Route::controller('hoge', 'RegisterController');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment