Next API - Login
Learn how to issue Laravel Sanctum tokens that let API users perform auth-only operations.
We'll cover the following...
Stateless world
The API world is stateless. When users interact with regular websites, there are cookies, sessions, and other mechanisms to maintain the state of the visit. When users travel through different pages, the server knows who is accessing the page and renders the data accordingly.
In the case of API, we do not have sessions. One of the standard methods that can to identify the user is tokens. Laravel Sanctum allows us to issue tokens and identify users effortlessly. Let’s utilize that.
Preparation of the model
Before we ...