Blog Detail

7

Jul
An Easy and Qucik Start With Laravel 8 and Jetstream cover image

An Easy and Qucik Start With Laravel 8 and Jetstream

Laravel 8 introduced a beautifully designed application starter kit known as Laravel Jetstream that provides an ideal starting point for your next Laravel application. It is a new application scaffolding for Laravel. Laravel Jetstream replaces the legacy of Laravel authentication UI applicable for earlier Laravel versions.

Why Choose Laravel Jetstream?

Laravel Jetstream provides the implementation for your application's login, email verification, registration, two-factor authentication, session management, API through Laravel Sanctum, and optional team management points. It is a free and open-source framework that utilizes Tailwind CSS, and you can decide between Laravel Livewire or Inertia.

Installation of Laravel Jetstream

You need to run the following command to install the Jetstream via composer in your laravel project.

composer require laravel/jetstream

After installing the Jetstream in your project, you can perform the jetstream:install Artisan command. This command acquires the name of the stack you prefer (livewire or inertia).

You are highly recommended to study the whole documentation of Laravel Livewire or Inertia before starting your Jetstream project.

If you prefer Livewire with the Blade then you've to run:

php artisan jetstream:install livewire

And if you want to utilize Jetstream with the Inertia then you've to run:

php artisan jetstream:install inertia

You may also append the --teams flag to enable Laravel Jetstream team support.

Concluding the Installation

After Jetstream installation, you have to run these commands to build your NPM dependencies and migrate your database:

npm install
npm run dev
php artisan migrate

Authentication with Jetstream

Your latest Jetstream application provides unconventional features:

  1. Login form

  2. Two-factor authentication

  3. Registration form

  4. Password reset

  5. Email verification

You can find those views at:

resources/views/auth

Laravel Fortify

Behind the curtain, the authentication parts of Jetstream are powered by Laravel Fortify. It registers the routes and controllers that are required to execute all of Laravel's authentication peculiarities, including login, registration, password reset, email verification, and more. After Fortify installation, you can run the route:list Artisan command to view the routes that Fortify has registered.

You can locate the Laravel Fortify actions in the following directory:

app/Actions/Fortify/

And you can spot the Fortify configuration at:

config/fortify.php

In the fortify.php config file, you can perform some adjustments like enable and disable different features like:

'features' => [
        Features::registration(),
        Features::resetPasswords(),
        // Features::emailVerification(),
        Features::updateProfileInformation(),
        Features::updatePasswords(),
        Features::twoFactorAuthentication(),
    ],

The official documentation for Laravel Jetstream can be found on the Jetstream website. Laravel Jetstream Introduction

column1 column2 column3
content1 content2 content3

Published at : 07-07-2021

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

web application development client
web application development client
web application development client
web application development client
web application development client

Launch project