DONE: layout letter with letterhead and footer, notification for newly...
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Activity\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ActivityReportResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'activity_id' => $this->activity_id,
|
||||
'activity' => new ActivityResource($this->whenLoaded('activity')),
|
||||
'report_text' => $this->report_text,
|
||||
'prepared_by' => $this->prepared_by,
|
||||
'prepared_by_user' => $this->whenLoaded('preparedBy', fn () => [
|
||||
'id' => $this->preparedBy->id,
|
||||
'name' => $this->preparedBy->name,
|
||||
'email' => $this->preparedBy->email,
|
||||
]),
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
'updated_at' => $this->updated_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user