This document describes the authenticated user logic implemented in the Larafast API Boilerplate. The logic is primarily handled by the AuhUserController
class.
show
method in the AuhUserController
class is used to fetch the authenticated user. It returns a UserResource
instance for the authenticated user.
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.
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/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.