app/Http/Controllers/Api/Admin/UserController.php
/**
     * Display the specified resource.
     *
     * @param  string  $uuid
     * @return JsonResponse
     */
Display the specified resource.
@param  string  $uuid
@return JsonResponse
Display the specified resource . @param string $uuid @return JsonResponse
public function show(string $uuid): JsonResponse
    {
        try {
            $user = User::whereUuid($uuid)
                ->with(['admin']);
            if ($user->count() === 0) {
                throw new ModelNotFoundException(__('This user could not be found.'), HttpResponse::HTTP_NOT_FOUND);
            }
            activity('admin')
                ->performedOn($user->first())
                ->causedBy(auth()->user())
                ->log('viewed user');
            return response()->json(['user' => $user->first()], HttpResponse::HTTP_OK);
        } catch (ModelNotFoundException $e) {
            Log::debug(
                sprintf("Error in %s called by %s. [Message: %s]",
                    __METHOD__,
                    auth()->user()->name,
                    $e->getMessage()
                ));
            return response()->json([
                'message' => $e->getMessage(),
            ], $this->getErrorCode($e->getCode()));
        }
    }
public function show ( string $ uuid ) : JsonResponse { try { $ user = User :: whereUuid ( $ uuid ) -> with ( [ 'admin' ] ) ; if ( $ user -> count ( ) === 0 ) { throw new ModelNotFoundException ( __ ( 'This user could not be found.' ) , HttpResponse :: HTTP_NOT_FOUND ) ; } activity ( 'admin' ) -> performedOn ( $ user -> first ( ) ) -> causedBy ( auth ( ) -> user ( ) ) -> log ( 'viewed user' ) ; return response ( ) -> json ( [ 'user' => $ user -> first ( ) ] , HttpResponse :: HTTP_OK ) ; } catch ( ModelNotFoundException $ e ) { Log :: debug ( sprintf ( " Error in %s called by %s. [Message: %s] " , __METHOD__ , auth ( ) -> user ( ) -> name , $ e -> getMessage ( ) ) ) ; return response ( ) -> json ( [ 'message' => $ e -> getMessage ( ) , ] , $ this -> getErrorCode ( $ e -> getCode ( ) ) ) ; } }
Display the specified resource.
Display the specified resource .