Пример #1
0
 protected function mapAuthRoutes()
 {
     Route::group(['middleware' => 'web', 'namespace' => $this->namespace], function ($router) {
         Route::auth();
         Route::get('/logout', 'Auth\\LoginController@logout');
     });
 }
Пример #2
0
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use Illuminate\Support\Facades\Route;
Route::controllers(['test' => 'Test\\TestController', 'login' => 'Login\\LoginController']);
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web', 'test']], function () {
    //
    Route::match(['get', 'post'], '/web/{number}', function ($number) {
        return Response::json(['test']);
    });
});
Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('/home', 'HomeController@index');
});