DEV Community

Ariel Mejia
Ariel Mejia

Posted on

Add auth scaffold in Laravel 6.x

Add auth scaffold in Laravel 6 or higher.

Laravel 6

Since Laravel 6 was came out, the artisan command:

php artisan make:auth

It is not available anymore, the reason for this change is to avoid the misunderstanding of many developers who think that Laravel is tied to VueJS or Bootstrap, since Laravel can perfectly work with reactJS or angular in terms of Javascript frameworks and in terms of css frameworks Can work with taiwindCSS, materializeCSS or a custom style.

To add again the scaffold that typically came by default with Laravel from version 5.1 to 5.8, which includes VueJS and Bootstrap, you only need to execute the following commands:

composer require laravel/ui --dev

php artisan ui vue --auth

this can be found in the official documentation here

Everything perfect but, in each project I have to execute these commands?

Taylor Otwell recently updated the Laravel installer to make this task even easier with a flag on the command to create a new project in Laravel

composer global update laravel/installer

laravel --version

laravel new project --auth

You can read more about the changes in this Laravel news post

Change VueJS for reactJS?

To change VueJS for reactJS the laravel documentation have a command to change the scaffold

composer require laravel/ui --dev

php artisan ui react

// Generate login / registration scaffolding...

php artisan ui react --auth

Change Bootstrap for another CSS framework?

You can go to Laravel frontend presets and you can choose whatever implementation you need here: Laravel presents

I strongly recommend to try TailwindCSS preset is a really cool css framework without predefine components, but with a wide utilities to make your frontend development easier.

To install TailwindCSS you can visit the Laravel preset repo here Michael Dyrynda is doing a great job of maintaining this package.

Finally, if you want to implement any other css or javascript framework I leave you a link to the official documentation, with Laravel mix it is extremely easy, here Laravel presets docs

Top comments (3)

zaratedev profile image
Jonathan Zarate

It is awesome :) great

arielmejiadev profile image
Ariel Mejia

Thanks :)

jeremyhise profile image
Jeremy Hise

What I don't understand is why this didn't create the controller. After doing all this I just get "The requested URL /register was not found on this server."