Laravel 8 Auth (Registration and Login)
Step 1: Install a new Laravel app
composer create-project laravel/laravel projectapp --prefer-dist
The command above only install Laravel, however, if you want to install Jetstream together then either
Laravel new projectapp --jet
or
composer require laravel/jetstream
we are going with the first of only installing Laravel, I want to explain other things in the process.
Before we migrate, let’s catch one bug before it throws an error, go to App/Providers/AppServiceProvider.php
and add
Schema::defaultstringLength(191);
to the boot function, also add
use Illuminate\Support\Facades\Schema;
to the top
Step 3: Migration
php artisan migrate
Step 4: install Jetstream
composer require laravel/jetstream
Step 5: Install livewire or inertia
We need to install one of the stacks, either a livewire or an inertia stack, in this tutorial, I will only be using livewire because it set up everything I need for the app
php artisan jetstream:install livewire
As suggested, run npm install && npm run dev to build all the javaScript files and CSS we need for our app. On successful build, Laravel will send a notification at the bottom left.
Step 5: Migrate the new table that is created
php artisan migrate
Let’s run our app
php artisan serve
No comments:
Post a Comment