mini-aspire/app/Http/Controllers/API/Admin/AuthController.php
/**
     * Retrieve authenticated user
     *
     * @return [Object] Admin
     */
Retrieve authenticated user
@return [Object] Admin
Retrieve authenticated user @return [ Object ] Admin
public function update(UpdateAdminRequest $request)
    {
        try {
            $user = $request->user();
            $input = $request->validated();
            if(!empty($input['password'])){
                $input['password'] = Hash::make($input['password']);
            }
            $user = $this->_adminRepo->update($user->id, $input);
            return $this->success('Update profile successfully.', $user);
        } catch (\Throwable $th) {
            return $this->error('Error when logging out!', 500);
        }
        return $this->success('Retrieve user successfully.', new AuthAdminResource($request->user()));
    }
public function update ( UpdateAdminRequest $ request ) { try { $ user = $ request -> user ( ) ; $ input = $ request -> validated ( ) ; if ( ! empty ( $ input [ 'password' ] ) ) { $ input [ 'password' ] = Hash :: make ( $ input [ 'password' ] ) ; } $ user = $ this -> _adminRepo -> update ( $ user -> id , $ input ) ; return $ this -> success ( 'Update profile successfully.' , $ user ) ; } catch ( \ Throwable $ th ) { return $ this -> error ( 'Error when logging out!' , 500 ) ; } return $ this -> success ( 'Retrieve user successfully.' , new AuthAdminResource ( $ request -> user ( ) ) ) ; }
Retrieve authenticated user
 @return [Object] Admin
Retrieve authenticated user @return [ Object ] Admin
// throw $th;