*/ public function toArray($request) { return [ 'name' => $request->has('prefer_inner') && $this->inner_name ? $this->inner_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, 'fileshare' => $this->fileshare, '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(), ]; } }