From 30a6fe45226ba67c2c4928c814f1ed78f56ebe72 Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Tue, 10 Sep 2024 12:49:05 -0400 Subject: [PATCH] add team icons --- app/Http/Resources/ProjectResourceShow.php | 1 + app/Http/Resources/TeamResource.php | 8 +++++++- resources/js/Layouts/AppLayout.vue | 2 +- resources/js/Pages/Projects/Show.vue | 9 ++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/Http/Resources/ProjectResourceShow.php b/app/Http/Resources/ProjectResourceShow.php index 4692d24f..9bf9da6e 100644 --- a/app/Http/Resources/ProjectResourceShow.php +++ b/app/Http/Resources/ProjectResourceShow.php @@ -26,6 +26,7 @@ public function toArray(Request $request): array 'status_formatted' => str($this->status->name)->headline(), 'content' => $this->content, 'system_prompt' => $this->system_prompt, + 'team' => TeamResource::make($this->team), ]; } } diff --git a/app/Http/Resources/TeamResource.php b/app/Http/Resources/TeamResource.php index 0bfb1467..4fc7d3c8 100644 --- a/app/Http/Resources/TeamResource.php +++ b/app/Http/Resources/TeamResource.php @@ -14,6 +14,12 @@ class TeamResource extends JsonResource */ public function toArray(Request $request): array { - return parent::toArray($request); + return [ + 'id' => $this->id, + 'name' => $this->name, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'users' => UserResource::collection($this->users), + ]; } } diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index 1e86c452..bfb4242a 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -40,7 +40,7 @@ const theme = ref('dark')