Files
ntspi-app/app/Containers/User/UI/WEB/Transformers/PersonDepartmentsTeachResource.php
2026-03-20 21:47:02 +05:00

27 lines
628 B
PHP
Executable File

<?php
namespace App\Containers\User\UI\WEB\Transformers;
use App\Ship\Resources\JsonResource;
class PersonDepartmentsTeachResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray($request): array
{
return [
'id_department' => $this->id,
'title' => $this->title,
'faculty_title' => $this->faculty->title,
'slug' => $this->slug,
'faculty_slug' => $this->faculty->slug,
'position' => $this->pivot->teaching_position,
];
}
}