TeamMemberResource.php 672 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Resources\API;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class TeamMemberResource extends JsonResource
  6. {
  7. /**
  8. * Transform the resource into an array.
  9. *
  10. * @return array<string, mixed>
  11. */
  12. public function toArray(Request $request): array
  13. {
  14. return [
  15. 'id' => $this->id,
  16. 'user' => new UserProfileResource($this->user),
  17. 'user_id' => $this->user_id,
  18. 'role' => $this->role,
  19. 'limited' => $this->limited,
  20. 'join_at' => (string)$this->join_at,
  21. 'display_id' => $this->display_id,
  22. ];
  23. }
  24. }