orderByDesc('is_enabled') ->orderByDesc('is_bettable') ->orderBy('code') ->get() ->map(fn (Currency $currency): array => $this->serializeCurrency($currency)) ->all(); return ApiResponse::success(['items' => $items]); } /** @return array */ private function serializeCurrency(Currency $currency): array { return [ 'id' => (int) $currency->id, 'code' => $currency->code, 'name' => $currency->name, 'decimal_places' => (int) $currency->decimal_places, 'is_enabled' => (bool) $currency->is_enabled, 'is_bettable' => (bool) $currency->is_bettable, 'created_at' => $currency->created_at?->toIso8601String(), 'updated_at' => $currency->updated_at?->toIso8601String(), ]; } }