Do you know how to make authentication in Laravel 7? If you don’t know then you’re at the right place. I will let you know how to create an Auth using the laravel UI package in Laravel 7. In this blog, I will show you the authentication credentials in laravel 7.
Authenticatication in Laravel 7 with Laravel ui Package
Laravel 7 makes implementing authentication much easier. In fact, almost everything is prepared for you right out of the box. Laravel 7 offers a developer package to set up an Auth scaffold in the laravel 7 application. Whenever you want to create an Authentication in laravel 7 you will need to install the laravel / UI package in laravel 7.
Laravel UI Package for Creating Authentication
The configuration file is available in config / Author.php. Using
laravel / UI you can create simple views with the author as you did before. But in laravel 6 or 7 you can use Vue js or react js or a simple bootstrap view, UI Auth, in laravel 7. Let’s get started.
You need to follow a few steps to complete auth in your laravel 7 application. First, you need to install the laravel/UI package.
composer require laravel/ui
And then you have to run below command to check ui commands info..
php artisan ui --help
After running this command you will get the below output.
Description: Swap the front-end scaffolding for the application Usage: ui [options] [--] Arguments: type The preset type (bootstrap, vue, react) Options: --auth Install authentication UI scaffolding --option[=OPTION] Pass an option to the preset command (multiple values allowed) -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Now you can use following commands for creating auth:
With Bootstrap :
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
Now you have to run npm command to get better layout. So run it
And compile it by running this command.
npm run dev
I hope it can help you.