$model->uuid, 'name' => $model->name, 'title' => $model->title ]; } public function includeCompany(Department $model): ?Item { return $model->company ? $this->item($model->company, new CompanyTransformer()) : null; } public function includeParent(Department $model): ?Item { return $model->parent ? $this->item($model->parent, new DepartmentTransformer()) : null; } public function includeChildren(Department $model): Collection { return $this->collection($model->children, new DepartmentTransformer()); } public function includeMembers(Department $model): Collection { return $this->collection($model->members, new CompanyMemberTransformer()); } }