Table of Contents
For every web application – login & registration must be a needed part. Inside this article we will see Laravel 8 Authentication using Jetstream with livewire. We will use livewire in this tutorial for laravel 8 authentication.
Laravel founder Taylor otwell released laravel jetstream with livewire with simple authentication scaffolding but poweful to use.
Inside this we will see composer package for jetstream. Laravel 8 jetstream designed by Tailwind CSS. It publishes controllers for authentication system, views and routes to laravel application.
Apart from Livewire we can also use Interia.js for authentication scaffolding when we work with vue.js
Learn More –
- Concept of Global Middleware in Laravel 8 Tutorial
- Concept of Group Middleware in Laravel 8 Tutorial
- Concept of Route Group in Laravel 8 Tutorial
- Concept of Route Middleware in Laravel 8 Tutorial
Let’s get started – Laravel 8 Auth Scaffolding using Livewire Jetstream
Installation of Laravel Application
Laravel Installation can be done in two ways.
- Laravel Installer
- By using composer
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 –
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.
Database also configured with application.
We will use composer command to install jetstream library. Open project to terminal and hit this command into it.
$ composer require laravel/jetstream
While Installation you should see console screen like this.
Create Auth with Livewire
Now, we are going to install livewire which will create authentication system for application. It consists of Login, Registration, Forgot Password, Profile, Dashboard, Two Setup authentication, Email verification etc.
To install Livewire –
$ php artisan jetstream:install livewire
When we install we should see console screen like in this way –
Next, we need to run command to install node js pacakges.
Installing Node Js Packages
Back to terminal and type this command and run.
$ npm install && npm run dev
This will give a screen view as –
Next, we need to migrate tables into database.
$ php artisan migrate
Generated Scaffolding Files
When we open jetsream.php file, we will see ‘stack’ => ‘livewire’, because we are using livewire as stack.
Configuration Files at /app/config
Feature List of authentication module
Action Files at /app/Actions
Blade Template Files or scaffolding files at /resources/views
Open project to terminal and type the command to start development server
$ php artisan serve
When we click on register link, it will open
For Login page,
We hope this article helped you to learn about Laravel 8 Authentication using Jetstream with Livewire in a very detailed way.
Find More on Laravel 8 Articles here
- How to Create Multi Language Website in Laravel 8
- How To Read XML File in Laravel 8 – Example
- How To Upload And Save XML Data in Laravel 8
- Laravel 8 Ajax Post Request Tutorial
- Laravel 8 Authentication using Jetstream with Inertia Js
- Laravel 8 Authentication using Jetstream with Livewire
- Laravel 8 Authentication with Breeze Tutorial
- Laravel 8 Clear Cache of Route, View & Config
- Laravel 8 Cron Job Task Scheduling Tutorial
- Laravel 8 DataTable Ajax Pagination with Search And Sort
- Laravel 8 Firebase Push Notification Tutorial
- Laravel 8 Form Validation Methods
- Laravel 8 Installation Guide – PHP Framework
- Laravel 8 Layouts And Views Complete Guide
- Laravel 8 Routing Tutorial Step by Step Guide
- Laravel 8 Send Mail using Gmail SMTP Server
- Laravel 8 Send Push Notification to Android Using Firebase
- Laravel 8 Send Push Notification to IOS Using Firebase
- Laravel 8 Stub Customization