Explorar o código

add created_at

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
8f665a5dcc
Modificáronse 1 ficheiros con 7 adicións e 4 borrados
  1. 7 4
      app/Http/Resources/UserResource.php

+ 7 - 4
app/Http/Resources/UserResource.php

@@ -17,10 +17,13 @@ class UserResource extends JsonResource
     public function toArray($request)
     public function toArray($request)
     {
     {
         $data = [
         $data = [
-            "id"=>$this->userid,
-            "userName"=> $this->username,
-            "nickName"=> $this->nickname,
-            "email"=> $this->email,
+            "id" => $this->userid,
+            "userName" => $this->username,
+            "nickName" => $this->nickname,
+            "email" => $this->email,
+            "role" => json_decode($this->role),
+            "created_at" => $this->created_at,
+            "updated_at" => $this->updated_at,
         ];
         ];
         if($this->avatar){
         if($this->avatar){
             $data['avatarName'] = $this->avatar;
             $data['avatarName'] = $this->avatar;