User Profile
This document describes the authenticated user logic implemented in the Larafast API Boilerplate. The logic is primarily handled by the AuhUserController
class.
Fetching Authenticated User
The show
method in the AuhUserController
class is used to fetch the authenticated user. It returns a UserResource
instance for the authenticated user.
Updating Authenticated User
The update
method in the AuhUserController
class is used to update the authenticated user’s details. It accepts an UpdateUserRequest
instance which validates the incoming request data. The rules
method of this class specifies that the name
, email
, and password
fields are optional, but if provided, they must meet certain criteria.
Deleting Authenticated User
The destroy
method in the AuhUserController
class is used to delete the authenticated user. It deletes the authenticated user from the database and returns a success message.
Routes
The routes for fetching, updating, and deleting the authenticated user are defined in the routes/auth.php
file. All these routes use the AuhUserController
class, and the show
, update
, and destroy
methods respectively. These routes are grouped under a middleware that ensures only authenticated users can access them.
This concludes the overview of the authenticated user logic in the application.