$attr) { $plural_type = Str::plural($type); $name = $attr['translation']['prefix'] . '.' . $plural_type; if (!empty($attr['alias'])) { $name = $attr['alias'] . '::' . $name; } $types[$type] = trans_choice($name, 1); } return $types; } public function getCategoryWithoutChildren(int $id): mixed { return Category::getWithoutChildren()->find($id); } public function getTransferCategoryId(): mixed { return Category::other()->pluck('id')->first(); } public function isTransferCategory(): bool { $id = $this->id ?? $this->category->id ?? $this->model->id ?? 0; return $id == $this->getTransferCategoryId(); } }