toArray(); } public static function edit(array $params): bool { try { League::update([ 'id' => $params['id'], 'label' => $params['label'], 'icon' => $params['icon'] ?? '', 'sort' => $params['sort'] ?? 0, 'is_show' => $params['is_show'] ?? 1, ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } public static function delete(array $params) { League::destroy($params['id']); } }