<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for 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.
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::auth();
Route::get('/home', 'HomeController@index');
Laravel routes.php
。因此,当我查看Laravel 5.2的Auth示例时,我总是会看到事物Route::auth();
并Route::get('/home', 'HomeController@index')
封装在{
其中Route::group(['middleware' => ['web']], function () {
。但是,每当我使用命令时,php artisan make:auth
它所做的就是创建上面显示的命令。
关于为什么这样做的任何线索?它可以正常工作,但我不确定它是否运行正常,但不能百分百确定。但我可以告诉您,我可以正确登录和注册。他们对Laravel进行了任何更改吗?
现在默认情况下将应用Web中间件:
https://github.com/laravel/laravel/tree/master/app/Http
同样在Kernel.php中
https://github.com/laravel/laravel/blob/master/app/Http/Kernel.php
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句