Imagine the following situation: in an API implemented in PHP and Laravel, we need to create an entity for users who are authenticated in another specific API, which provides only user data and not an authentication token.
This is a fairly common situation for most developers these days, and if you haven't experienced it yet, rest assured, that day will come soon.
Well, in this case, it's recommended that, in addition to implementing an internal authentication layer without using the User model, we also implement authentication token generation and user session management.
So, what we'll use is:
- PHP 8.x;