In this article, we will discuss "Laravel Sanctum - Restful API Authentication" . Laravel Sanctum provides a simple authentication system for mobile applications, SPA (Single Page Application), and token-based API. We can generate multiple API tokens for the user account. Also, we can assign abilities/scopes which specify which actions the tokens are allowed to perform. For example, we can assign abilities as per the user roles. Laravel Sanctum or Laravel Passport ? Passport provides a complete solution for OAuth2 authentication. If OAuth is not required in your project then Sanctum is right for your application. Sanctum is light and easy to implement. Prerequisites Knowledge of Laravel, you can check our other post on Laravel . Basic knowledge of HTTP client postman. You are free to use any of HTTP client, s Getting Started Let's setup a new Laravel application, use the following composer command into the terminal. composer create-project laravel/laravel la...
Share, Read & Learn