Use Laravel Sanctum To Make Laravel Api Authentication For Users - FreeCodeBlog
Last updated: Nov 09, 2021
In this tutorial I will use laravel sanctum package to make laravel api authentication for users. For spa authentication or laravel vue api authentication you need to use laravel fast party package (laravel sanctum).
Skip this tutorial If you have a laravel website that used laravel jet-stream package because laravel jetstream included laravel sanctum by default.
Laravel To Make Sanctum Api Authentication.
Please install laravel 8 to use laravel sanctum to make laravel API authentication. I already installed laravel 8. If you don't know how to install laravel then read how to install any kind of laravel version tutorial.
Laravel Sanctum To Make Api Authentication.
Now you need to install laravel sanctum first party package.
composer require laravel/sanctum
Next, you should publish the Sanctum configuration and migration files using the below artisan command. The sanctum configuration file will be placed in your application's config directory.
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
Laravel Ui To Make Sanctum Api Authentication.
If you haven't installed laravel ui 3 or don't know how to install laravel ui 3 then read install laravel ui package in any kind of laravel version tutorial. For this tutorial I already installed laravel ui 3 to use laravel sanctum for API authentication.
Compile CSS & Js Files To Make Sanctum Api Authentication.
If you don't know much about css and js files complication then read how to compile laravel css and js files tutorial. Don't forget to compile css and js files after use laravel sanctum to make API authentication.
Database Connection To Make Sanctum Api Authentication.
I already connect MySQL database with my use laravel sanctum API project. read how to connect database connection in laravel tutorial if you don't know about laravel database connection.
Send a code sms to user phone number for number verification when user will register with phone number in laravel 8. In this tutorial I will... Read More
Laravel 8 breeze moment js with vue 3! Want to use moment js in laravel 8 vue 3 with laravel breeze inertia js? Yes! Okay sometimes you may need to... Read More
Want to make laravel ui vue, react, bootstrap email verification using laravel ui version 3, 2, 1? Laravel ui has a feature for users to verify ema... Read More
Install and use laravel ui package in laravel 8 with Vue 2 to make user authentication. Laravel UI is a new first-party package that extracts the U... Read More
Today I will explain you, how we can easily deploy a laravel 8 project on namecheap shared hosting cpanel. If you have a namecheap shared hosting s... Read More