laravel 5.3 new Auth::routes()

后端 未结 10 1450
清歌不尽
清歌不尽 2020-12-04 05:26

Recently I start to use laravel 5.3 to write a blog, but I have a question after run php artisan make:auth

when I run this, it will generate routes in m

10条回答
  •  盖世英雄少女心
    2020-12-04 06:07

    Here's Laravel 5.7, Laravel 5.8, Laravel 6.0, Laravel 7.0, and Laravel 8.0 (note a minor bc change in 6.0 to the email verification route).

    // Authentication Routes...
    Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
    Route::post('login', 'Auth\LoginController@login');
    Route::post('logout', 'Auth\LoginController@logout')->name('logout');
    
    // Registration Routes...
    Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
    Route::post('register', 'Auth\RegisterController@register');
    
    // Password Reset Routes...
    Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
    Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
    Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
    Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
    
    // Confirm Password (added in v6.2)
    Route::get('password/confirm', 'Auth\ConfirmPasswordController@showConfirmForm')->name('password.confirm');
    Route::post('password/confirm', 'Auth\ConfirmPasswordController@confirm');
    
    // Email Verification Routes...
    Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
    Route::get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify'); // v6.x
    /* Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify'); // v5.x */
    Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
    

    You can verify these routes here:

    • v5.7 https://github.com/laravel/framework/blob/5.7/src/Illuminate/Routing/Router.php#L1176
    • v5.8 https://github.com/laravel/framework/blob/5.8/src/Illuminate/Routing/Router.php#L1151
    • v6.0 https://github.com/laravel/framework/blob/6.x/src/Illuminate/Routing/Router.php#L1178
    • v7.0 https://github.com/laravel/ui/blob/2.x/src/AuthRouteMethods.php (This has been moved to the laravel/ui package)
    • v8.0 https://github.com/laravel/ui/blob/3.x/src/AuthRouteMethods.php (No changes other than adding optional namespace)

提交回复
热议问题