Tuesday, 09 Apr, 2024 -133

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: 1958
img
Xampp Tutorial Create Your Own Local Test Server
02 Apr, 2024 view: 885
img
How to Install Laravel
02 Apr, 2024 view: 819
img
PHP is not recognized as an internal or external command
02 Apr, 2024 view: 610
img
How to Install Composer on Windows
01 Apr, 2024 view: 608
img
Summernote image upload
01 Nov, 2023 view: 554
img
How to clear select2 selected value in js
01 Nov, 2023 view: 426
img
Zipping and Unzipping Files in Linux
02 Apr, 2024 view: 376
img
How to add Datepicker in Bootstrap
26 Apr, 2024 view: 372
img
How to Import a MySQL Database using Command Line
02 Apr, 2024 view: 366
img
How to Installation Laragon
01 Apr, 2024 view: 213
img
How to Installing an SSL certificate on your server using cPanel
06 Apr, 2024 view: 184
img
Paypal Payment Gateway Integration With Laravel
06 Apr, 2024 view: 153
img
How to Use Laravel Middleware to Protect Your Application
09 Apr, 2024 view: 145
img
Laravel Cache Clear Command Php Artisan Optimize
09 Apr, 2024 view: 144
img
why important website development learn
10 Apr, 2024 view: 137
img
How to Integrate Stripe Payment in Laravel
06 Apr, 2024 view: 134
img
Laravel Authentication Tutorial
09 Apr, 2024 view: 133
img
laravel qr code generator package
18 Apr, 2024 view: 132
Trending