Laravel 6 and 7 Authentication
Laravel simplifies authentication implementation, providing robust, out-of-the-box support for common authentication tasks. Laravel 6 introduced Laravel UI, a separate package, to manage authentication scaffolding, whereas Laravel 7 continued to refine these features, ensuring a smoother developer experience.
Moreover make:auth command no longer exists in Laravel 6 and Laravel 7.So if we want to use laravel auth in laravel 6/7 applications then we need to use the Laravel UI package(laravel/ui).
1) Install Laravel UI (For laravel 6)
Use Composer to install the Laravel UI package and generate the auth scaffolding.
To install composer package laravel/ui run
composer require laravel/ui
After installing of above package, we will have a couple of new commands available.To see new commands run.
ui:auth Command
To generate authentication views we need to run following artisan command.
It will generate
- HomeController
- auth routes
- auth views( registration, forgot password, login, reset password views )
- app.blade.php
To generate only views in your existing application then you need to add --views.
For example: