Adding Login Authentication on Laravel 6 & 7 Application

If this is your first time using Laravel 6 or 7 and also trying to scaffold login authentication you’ll quickly discover that make:auth command is no longer working — this is because there was an update on Laravel 6 and above which they moved the authentication scaffolding into a separate laravel/ui package.

Today I will show you how to scaffold and bootstrap your Laravel 6 app with login authentication.

Step 1

Use CLI to access your Laravel project folder for my case the Laravel app folder is blog.

$ cd blog
$ composer require laravel/ui

Step 2

$ php artisan ui vue --auth

After initiating this command from CLIphp artisan ui vue --auth Laravel will create all required files needed for your login authentication to function. Auth controllers files would be found here in this folder on your project Controller/auth and the views will be here resources/auth folder.

Now run your Laravel app $ php artisan serve

Viewing your authentication login page you’ll notice that no styling was added by Laravel. This is because the UI package for laravel 6 and above has been separated which does not come with styling out of the box. To add the styling you need to compile the UI files which take us to the next step.

Step 3

Download Node package manager if you don’t have one click here to download.

After installation of node package manager open your CLI and type the command.

$ npm install
$ npm run dev

Step 4

Run your Laravel application and access it from your browser it would look like this:

You can read more about scaffolding Laravel app from the documentation.

Conclusion

You have seen how to scaffold login authentication on Laravel 6 and above and how the command syntax differs from previous versions with these simple steps. If you’ve any issues while scaffolding your login authentication feel free to drop your comment below.

Google Product Expert | Developer Advocate I Social Media Specialist