Laravel 8.x Auth Example with Jetstream
I am totally shoked after seeing the update of Laravel 8. Laravel 8 has totally changed the auth scaffolding man. Did you check it? You know that Laravel 7 uses Laravel's
laravel/ui package to create auth scaffolding. But in Latest version of Laravel 8 , in this version laravel uses Laravel's
laravel/jetstream package that provides a quick way to scaffold auth.
Now in this Laravel 8 authentication example tutorial i will guide you how we can set up Laravel 8 and run Laravel authentication system successfully in our Laravel 8 application with jetstream. Now take a look that what is Jetstream.
Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management. Now let's start our Laravel 8 authentication tutorial.
First, download the Laravel installer using Composer:
composer global require laravel/installer
now run below command to download a latest laravel 8 application.
laravel new laravel8 --jet
Before we have installed the Laravel Installer, so you may use the
--jet option to create a new Jetstream powered Laravel application: Run above command to get new Laravel with jetstream features.
Now in this step we need to migrate our database. So run below command. It will migrates many tables.
php artisan migrate
And finally run below command to compile our js file.
npm install //then npm run dev
Now after running php artisan serve command you can visit the root url. Now if you want to disable registration or update password or reset password you can open fortify.php and comment or uncomment the below line of code which features you want include or exclude.
'features' => [ Features::registration(), Features::resetPasswords(), // Features::emailVerification(), Features::updateProfileInformation(), Features::updatePasswords(), Features::twoFactorAuthentication(), ],
Hope this Laravel 8 auth tutorial will help you.