Tuesday, 09 Apr, 2024 -207

Laravel Authentication Tutorial

We'll walk through the process of adding authentication to your Laravel  application step-by-step in this article.

Laravel: What is it?

An open-source PHP web application framework with a beautiful, expressive syntax is called Laravel. It is an MVC framework for PHP web application development, ranging from basic to advanced.

The MVC (Model-View-Controller) architecture paradigm is adhered very rigidly in Laravel. It is renowned as a web framework for having exquisite and sophisticated syntax.

Important Laravel Features

Some of the main features of Laravel are:

* Eloquent ORM

* Query builder

* Reverse Routing

* Restful Controllers

* Migrations

* Database Seeding

* Unit Testing

* Homestead

* Source code hosted on GitHub and licensed under MIT License.

*  The most popular PHP framework on Github for developing custom apps.

*It differs in that it can utilize all of PHP's new features.

* Friendly online community

* Detailed documentation

* Security


1. Install Laravel Project

First, open Terminal and run the following command to create a fresh laravel project:

composer create-project laravel/laravel
2. Configure Database Details:

After, Installation Go to the project root directory, open .env file, and set database detail as follow:

DB_CONNECTION=mysql 
DB_HOST=127.0.0.1 
DB_PORT=3306 
DB_DATABASE=<DATABASE NAME>
DB_USERNAME=<DATABASE USERNAME>
DB_PASSWORD=<DATABASE PASSWORD>

Now run the database migration command:

php artisan migrate

3: Create Auth using scaffold

Now, in this step, we will create auth scaffold command to create a login, register, and dashboard.

composer require laravel/ui
Generate basic scaffolding and login and registration for bootstrap
php artisan ui bootstrap
php artisan ui bootstrap --auth
Generate basic scaffolding and login and registration for Vue 
php artisan ui vue
php artisan ui vue --auth

Generate basic scaffolding and login and registration for react

php artisan ui react
php artisan ui react --auth

Generate basic scaffolding

php artisan ui bootstrap
php artisan ui vue
php artisan ui react

4: Install NPM dependencies

Run this following command to install node dependency and compile CSS and js files:

npm install && npm run dev
5. Test the authentication system
Now our Laravel  Authentication is ready to use. To verify whether authentication has been setup successfully. First Run the project.

php artisan serve


Tags
Most Popular
img
How to install WordPress
02 Apr, 2024 view: 2083
img
Xampp Tutorial Create Your Own Local Test Server
02 Apr, 2024 view: 1184
img
How to Install Laravel
02 Apr, 2024 view: 942
img
PHP is not recognized as an internal or external command
02 Apr, 2024 view: 723
img
How to Install Composer on Windows
01 Apr, 2024 view: 723
img
Summernote image upload
01 Nov, 2023 view: 668
img
How to clear select2 selected value in js
01 Nov, 2023 view: 494
img
Zipping and Unzipping Files in Linux
02 Apr, 2024 view: 442
img
How to add Datepicker in Bootstrap
26 Apr, 2024 view: 440
img
How to Import a MySQL Database using Command Line
02 Apr, 2024 view: 431
img
How to Installation Laragon
01 Apr, 2024 view: 283
img
How to Installing an SSL certificate on your server using cPanel
06 Apr, 2024 view: 255
img
Paypal Payment Gateway Integration With Laravel
06 Apr, 2024 view: 216
img
How to Use Laravel Middleware to Protect Your Application
09 Apr, 2024 view: 212
img
Laravel Authentication Tutorial
09 Apr, 2024 view: 207
img
Laravel Cache Clear Command Php Artisan Optimize
09 Apr, 2024 view: 207
img
laravel qr code generator package
18 Apr, 2024 view: 198
img
How to Integrate Stripe Payment in Laravel
06 Apr, 2024 view: 197
img
why important website development learn
10 Apr, 2024 view: 194
img
How to Install Laravel Valet on Windows
26 Feb, 2025 view: 21
img
Learn how to implement Single Sign-On (SSO) in Node.js using Passport.js and TypeScript for enhanced user experience and secure ...
26 Feb, 2025 view: 6
Trending