Top Menu

In this tutorial, we’ll be installing and using the Laravel 9 authentication UI tutorial. This tutorial will show you how to create a simple authentication using the Laravel 9 framework and the Laravel UI package. we’ll walk you through each step and explain everything in details so you can eassily follow along.

Laravel/UI package is a composer package for Laravel which needs to be installed first using composer
before working with it. Follow the steps below to install Laravel 9 with composer command.

If you are looking for an article that gives you an understanding of laravel 9 authentication
with laravel UI then this article will help you a lot. The article contains only classified information
about laravel 9 authentication with laravel UI. the first section of the article is aboout installation.
We will teach you how to install laravel authentication UI in laravel 9 application.

Lets get start. Install the Laravel UI package into your laravel application we will need to install the
composer Package Manager to ourproject.

Laravel Installation

Open terminal and run this command to create a laravel project.

$ composer create-project laravel/laravel myblog

It will create a project folder with name myblog inside your local system.

To start the development server of laravel –

$ php artisan serve
URL: http://127.0.0.1:8000
Assuming laravel is already installed inside your system.

Create Database & Connect

To create a database, either we can create via Manual tool of PhpMyadmin or by means of a mysql command.

CREATE DATABASE laravel_app;

To connect the database with the application, Open .env file from the application root. search for DB_
and update your details. Then run the following command to initialize the databasee connection.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel9
DB_USERNAME=root
DB_PASSWORD=root

Laravel 9 Authentication with Laravel UI

We are using Laravel UI to create application authentication sections like login, registration etc.
To use Laravel UI we first need to install it in our laravel application by running the following comman
inside the oriject. After that we will create a bisic auth for the application and the and the needed
views in the views folder.

Install Laravel UI

Open Laravel project to terminal and type the given command.

$ composer require laravel/ui

Once the laravel/UI package has been installed, you need to install the frontend scaffolding using the UI
artisan command. run the following command inside the laravel folder to install the frontend scaffolding with laravel UI

$ php artisan ui bootstrap --auth

This command generates – login, register, app, etc layout scaffolding files.

After this command need to run the command

$ npm install && npm run dev
It will generate CSS and JS compiled files for authentication system.

Run Migration

Next, we need to run the migration command to generate in database. Open a terminal and run this artisan command

$ php artisan migrate

Application Testing

Open project to terminal and type the command to start development server.

$ php artisan serve

We will get Login and Register Link at landing page.

When you click on Log in link, you will see this login page.

Login

You need to provide email address and password for login to dashboard.

Register

To register a new user, you need to provide name, email address, password, confirm password

Reset Password

When you forgot your password, click on the link given at Log in page.

About The Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Close