1. Install the Laravel UI package:
Install the Laravel UI official package for making auth scaffolding in Laravel
composer require laravel/ui
2. Generate auth scaffolding:
After installation of Laravel UI package. We are now able to scaffold our auth with Bootstrap, Vue, React etc.
php artisan ui:auth
Solution of "Vite manifest not found":
1. composer require laravel/breeze
2. php artisan breeze:install
If reset password not working, giving error: "Call to undefined function mb_strcut()":
sudo apt-get install php8.2-mbstring
(php version will be changed accordingly)
=====================================================================
Authentication system with Laravel Sanctum:
1. install laravel new project_name
2. make migration for user table
3. install laravel sanctum using composer
composer require laravel/sanctum
4. publish the Sanctum configuration and migration files
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
5. Migrate database, Sanctum will create one database table in which to store API tokens.
php artisan migrate
6. Update Http Karnel: you should add Sanctum's middleware to your api middleware group within your application's app/Http/Kernel.php file
7. Issuing API Tokens: Sanctum allows you to issue API tokens / personal access tokens that may be used to authenticate API requests to your application.
8. Token creation:
9. Protecting Routes:
Group Route:
10. Logout by deleting Token:
0 Comments