Jetstream- A replacement for legacy Laravel authentication UI
There is a Laravel authentication UI available for all previous Laravel versions and JetStream is a new application scaffolding.
JetStream will give you a good start. It has the following components.
Login, registration functionality
Email verification
Two factor authentication
Session management
API support via Laravel sanctum.
Jetstream uses technologies like Tailwind CSS, Livewire/Inertia. It's free and open source. You can install laravel Jetstream using Laravel installer or composer. In the latest Laravel installer use the below command.
new project-name --jetThen run migrations using artisan command.
php artisan migrateUsing Composer install Jetstream with the following command.
composer require laravel/jetstreamThen run artisan jetstream:install command along with the stack name you want to use.
php artisan jetstream:install livewireIf you want to use Inertia with Vue run the below command.
php artisan jetstream:install inertiaAuthentication You can find all components like login form, two-factor authentication, registration form, password reset, email verification etc in resources/views/auth. It’s backend logic is made using Fortify and the fortify actions can be found at app/Actions/Fortify/. Fortify locations are located in config/fortify.php. In this file you can make some changes like enable and disable features like:
'features' => [ Features::registration(), Features::resetPasswords(), // Features::emailVerification(), Features::updateProfileInformation(), Features::updatePasswords(), Features::twoFactorAuthentication(), ],User profile management functionality allows users to update their name, email address, profile photo. User profile is located in the given location below.
resources/views/profile/update-profile-information-form.blade.phpIf you selected Inertia user profile can be found at: resources/js/Pages/Profile/UpdateProfileInformationForm.vue The user update logic is handled in the file: app/Actions/Fortify/UpdateUserProfileInformation.php If you want to disable user profile picture through Jetstream config file. config/jetstream.php You can comment out Features::profilePhotos() lines.
'features' => [ // Features::profilePhotos(), Features::api(), // Features::teams(), ],Jetstream has standard security features. Impressive feature of jetstream is two factor authentication with a QR code which users can disable and enable directly. Another feature is that users can log out other browser sessions as well. Jetstream uses Laravel sanctum to provide token based API. Users can generate API tokens with permissions like Create, Read, Update, Delete. Tokencan method can be used as shown below to check incoming requests.
$request->user()->tokenCan('read');Your website will support team creation and management if you have used --team flag during Jetstream installation.
Comments
0 comments
Please Sign in or Create an account to Post Comments