Simple Authentication
URI | METHOD |
---|---|
/api/register | POST |
/api/login | POST |
/api/logout | GET |
Test with Postman
You can import the postman collection and import the postman environment
Just replace the {{base_url}}
variable for your app url, you can send requests with json data to test all endpoints.
Register
Fields required to register a user:
{
"name": "John Doe",
"email": "john@doe.com",
"password": "YourPassword",
"password_confirmation": "YourPassword"
}
Login
Fields required to login a user:
{
"email": "john@doe.com",
"password": "YourPassword"
}
Logout
The logout request only needs the token.
Customize the basic authentication process
VALIDATION | CONTROLLER |
---|---|
app/Http/Requests/JsonApiAuth/RegisterRequest.php | app/Http/Controllers/JsonApiAuth/RegisterController.php |
app/Http/Requests/JsonApiAuth/LoginRequest.php | app/Http/Controllers/JsonApiAuth/LoginController.php |
no have request | app/Http/Controllers/JsonApiAuth/LogoutController.php |