Files
ntspi-app/app/Http/Resources/ClientPersonDepartmentsTeachResource.php
T
2024-09-19 16:06:49 +05:00

27 lines
661 B
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ClientPersonDepartmentsTeachResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $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,
];
}
}