generated from liutk/owl-admin-base
31 lines
763 B
PHP
31 lines
763 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AgreementResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'images' => $this->images,
|
|
|
|
'employee_id' => $this->employee_id,
|
|
'employee' => EmployeeResource::make($this->whenLoaded('employee')),
|
|
|
|
'workflow_check' => WorkflowCheckResource::make($this->whenLoaded('workflow')),
|
|
|
|
'created_at' => $this->created_at->timestamp,
|
|
];
|
|
}
|
|
}
|