get()->select( ['id', 'attributes'] )->toArray(); } public static function getTypeList(): array { return self::query()->where('is_default', 0)->get()->select( ['id', 'attributes'] )->each(function ($item) { $item['attributes'] = AdminTranslationService::getTranslationTypeName( $item['id'], 2, $item['attributes'] ); return $item; })->toArray(); } public static function getAttr($id) { $attributes = self::query()->where('id', $id)->value('attributes') ?? ''; return AdminTranslationService::getTranslationTypeName( $id, 2, $attributes); } public static function getData(): array { return self::query()->select(['id', 'attributes'])->get() ->each( function ($item) { $item['attributes'] = AdminTranslationService::getTranslationTypeName( $item['id'], 2, $item['attributes'] ); return $item; } )->toArray() ?? []; } }