|
|
@@ -33,11 +33,12 @@ class UserResource extends JsonResource
|
|
|
'position' => $this->whenLoaded('position', fn() => ['id' => $this->position->id, 'name' => $this->position->name]),
|
|
|
'sector_id' => $this->sector_id,
|
|
|
'sector' => $this->whenLoaded('sector', fn() => ['id' => $this->sector->id, 'name' => $this->sector->name]),
|
|
|
- 'photo_url' => $this->photo_path
|
|
|
- ? Storage::disk('s3')->temporaryUrl($this->photo_path, now()->addHours(24))
|
|
|
- : null,
|
|
|
- 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
- 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
+ 'photo_url' => $this->photo_path
|
|
|
+ ? Storage::disk('s3')->temporaryUrl($this->photo_path, now()->addHours(24))
|
|
|
+ : null,
|
|
|
+ 'unread_notifications_count' => (int) ($this->unread_notifications_count ?? 0),
|
|
|
+ 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
];
|
|
|
}
|
|
|
|