In this tutorial you will learn about the Laravel 7/6 Authentication Example Tutorial and its application with practical example.
In this Laravel 7/6 Authentication Example Tutorial I will show you how to generate authentication scaffolding in laravel. In this tutorial you will learn to enable or generate authentication in laravel 7/6 version. In the new version of laravel make: auth command is no longer exists. Now in this tutorial we will learn how you can easily generate auth scaffolding in Laravel.
Laravel UI
Laravel UI is a new package that extracts the UI files of a Laravel project. Use the following command to install the laravel/ui package via composer:
1 2 |
laravel new my-app composer require laravel/ui |
After installing laravel / UI package, we have to generate the UI code, including laravel authentication.
1 |
php artisan ui --help |
The laravel/ui package comes with views for VUE, React and Bootstrap. You are allowed to enable one of following front end framework for authentication module.
1 2 3 |
php artisan ui vue php artisan ui react php artisan ui bootstrap |
You can generate the auth scaffolding at the same time:
1 2 3 |
php artisan ui vue --auth php artisan ui react --auth php artisan ui bootstrap --auth |
The ui:auth Command
In addition to the new UI command, the larva / UI package comes with another command to generate scaffolding:
1 |
php artisan ui:auth |
If you run the ui: auth command, it will generate the organic root, HomeController, oral view, and app.blade.php layout files. If you want to generate only views use the below command:
1 |
php artisan ui:auth --views |
Now you need to run the below command for installing dependencies:
1 |
npm install |
1 |
npm run dev |