From d830c3ab846e88cf7609ec21c9999a4a697a17d1 Mon Sep 17 00:00:00 2001 From: irfan Date: Tue, 27 Oct 2020 23:44:59 +0700 Subject: [PATCH] add user profile controller --- .../Controllers/Api/V1/User/UserController.php | 14 ++++++++++++++ app/Http/Resources/UserResource.php | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 app/Http/Controllers/Api/V1/User/UserController.php create mode 100644 app/Http/Resources/UserResource.php diff --git a/app/Http/Controllers/Api/V1/User/UserController.php b/app/Http/Controllers/Api/V1/User/UserController.php new file mode 100644 index 0000000..32820cb --- /dev/null +++ b/app/Http/Controllers/Api/V1/User/UserController.php @@ -0,0 +1,14 @@ +user()); + return rest_api($user); + } +} \ No newline at end of file diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php new file mode 100644 index 0000000..545eff7 --- /dev/null +++ b/app/Http/Resources/UserResource.php @@ -0,0 +1,16 @@ + $this->name, + "email" => $this->email, + "avatar" => $this->avatar + ]; + } +} \ No newline at end of file