*/ public function toArray($request) { return [ 'name' => $this->name, 'inner_name' => $this->inner_name, 'parent_id' => $this->parent_id, 'id' => $this->id, 'level' => $this->level?->value, 'children_count' => $this->children_count, 'links' => [ 'children' => route('api.group', ['group' => $this->id]), ] ]; } /** * @return array */ public static function meta(): array { return [ 'links' => [ 'bulkstore' => route('group.bulkstore'), 'root_path' => route('api.group'), ], 'levels' => Level::forSelect(), ]; } }