Skip to content

Commit

Permalink
feat!: only display timestap data to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Apr 8, 2022
1 parent aeffb08 commit 424b61f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
"email": "[email protected]",
"email_verified_at": "2021-04-07T07:59:47.000000Z",
"gender": "male",
"birth": "1990-01-06T00:00:00.000000Z",
"created_at": "2021-03-24T13:03:48.000000Z",
"updated_at": "2021-03-24T13:05:11.000000Z",
"readable_created_at": "3 minutes ago",
"readable_updated_at": "1 minute ago"
"birth": "1990-01-06T00:00:00.000000Z"
},
"meta": {
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public function transform(User $user): array
'email_verified_at' => $user->email_verified_at,
'gender' => $user->gender,
'birth' => $user->birth,
'created_at' => $user->created_at,
'updated_at' => $user->updated_at,
'readable_created_at' => $user->created_at->diffForHumans(),
'readable_updated_at' => $user->updated_at->diffForHumans(),
];

return $this->ifAdmin([
'real_id' => $user->id,
'created_at' => $user->created_at,
'updated_at' => $user->updated_at,
'readable_created_at' => $user->created_at->diffForHumans(),
'readable_updated_at' => $user->updated_at->diffForHumans(),
], $response);
}

Expand Down

0 comments on commit 424b61f

Please sign in to comment.