Sanctum database error
I am working on two separate web apps, App front and App back. Both are developed in Laravel with the only difference that App front is for front end and the other is for the backend.
The App front has livewire while App back has all the API endpoints with sanctum installed.
The issue is when App front makes an api request to App back, I am getting the following error
{"message": "SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from `personal_access_tokens` where `personal_access_tokens`.`id` = 3 limit 1)"
I am making curl request from app front as it is in livewire.
The api works perfectly fine on postman. Also if I change the DB configurations on App front's .env file and make it same like App back, it works fine as well. I am testing these both on xampp server in my local environment.
Am I missing something as REST API are stateless and they do not need DB configuration on the front end side?
Thanks in advance :)
Please or to participate in this conversation.