DEV Community

Cover image for Log In & Registration With Laravel/Ui - In Laravel
Salman Abbas (سلیمان)
Salman Abbas (سلیمان)

Posted on

Log In & Registration With Laravel/Ui - In Laravel

Hello guys!

This post aims to give you the demonstration of " How to add authentication in laravel with laravel/ui package".

You can just follow some simple steps from this post to add log-in and registration options in laravel 8.x with the help of laravel/ui.

Step # 01: Create Laravel App

composer create-project laravel/laravel LaravelApp
Enter fullscreen mode Exit fullscreen mode

Open this app in your vs code editor.

Step # 02: Installing laravel/UI package
Run in vs code terminal

composer require laravel/ui
Enter fullscreen mode Exit fullscreen mode

Step # 03: Installing front end scaffolding
Now, You have three options here. (Bootstrap, Vue, React) You have to choose one.

For Bootstrap:

php artisan ui bootstrap
Enter fullscreen mode Exit fullscreen mode

For Vue:

php artisan ui vue
Enter fullscreen mode Exit fullscreen mode

For React:

php artisan ui react
Enter fullscreen mode Exit fullscreen mode

Step # 04: Now run

npm install
Enter fullscreen mode Exit fullscreen mode

and also

npm run dev
Enter fullscreen mode Exit fullscreen mode

Step # 05: Install Authentication

But remember if you choose bootstrap scaffolding in previous
command then you have to run the below command

php artisan ui bootstrap --auth
Enter fullscreen mode Exit fullscreen mode

and if you choose Vue then

php artisan ui vue --auth
Enter fullscreen mode Exit fullscreen mode

and if you choose React then

php artisan ui react --auth
Enter fullscreen mode Exit fullscreen mode

Now, you have successfully installed the authentication in your application.

Let's just run

php artisan migrate
Enter fullscreen mode Exit fullscreen mode

I hope this will help you to add authentication (login and registration) option in your laravel app with laravel/ui package.

If you are facing any issue regarding to this then feel free to mention in the comment.

Thanks!

Video Link:
https://www.youtube.com/watch?v=Agx4xITyYgQ&t

Top comments (0)