Laravel 8 Authentication with Laravel UI Tutorial

Share this Article
Reading Time: 4 minutes
998 Views

Inside this article we will see how to install Authentication with laravel ui package. laravel ui package provides the simple steps for authentication scaffolding. It is simple in ui, easy to install.

If you are looking for an article which gives you the understanding of Laravel 8 authentication with laravel ui then this article will help you a lot. Article contains only classified information about laravel 8 authentication with laravel ui.

Learn More –

Let’s get started.


Installation of Laravel Application

Laravel Installation can be done in two ways.

  • Laravel Installer
  • By using composer

Laravel Installer

To install Laravel via Laravel installer, we need to install it’s installer first. We need to make use of composer for that.

$ composer global require laravel/installer

This command will install laravel installer at system. This installation is at global scope, so you type command from any directory at terminal. To verify type the given command –

$ laravel

This command will open a command palette of Laravel Installer.

To create ad install laravel project in system,

$ laravel new blog

With the name of blog a laravel project will be created at your specified path.

By using composer

Alternatively, we can also install Laravel by Composer command create-project.

If your system doesn’t has composer Installed, Learn Composer Installation Steps.

Here is the complete command to create a laravel project-

$ composer create-project --prefer-dist laravel/laravel blog

After following these steps we can install a Laravel application into system.

To start the development server of Laravel –

$ php artisan serve

This command outputs –

Starting Laravel development server: http://127.0.0.1:8000

Assuming laravel already installed at 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 database with application, Open .env file from application root. Search for DB_ and update your details.

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

Laravel 8 Authentication with Laravel UI

We are using here Laravel UI to create application authentication section like login, registration, etc.

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:

$ php artisan ui bootstrap --auth

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 migration command to generate tables in database. Open 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

URL – http://127.0.0.1:8000/

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.

User Dashboard

Once user will login into application, redirected to dashboard page.

We hope this article helped you to learn Laravel 8 Authentication with Laravel UI Tutorial in a very detailed way.

Buy Me a Coffee

If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.

Learn Web Development Courses @ $4 only.
Web Development Courses @ $4