| @@ -192,10 +192,10 @@ | ||
| 192 | 192 | if (empty($data['slug'])) { |
| 193 | 193 | throw new \InvalidArgumentException('Trip slug is required'); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - if (!preg_match('/^[a-z0-9-]+$/', $data['slug'])) { | |
| 197 | - throw new \InvalidArgumentException('Trip slug can only contain lowercase letters, numbers, and hyphens'); | |
| 196 | + if (!preg_match('/^[\pL\pN-]+$/u', $data['slug'])) { | |
| 197 | + throw new \InvalidArgumentException('Trip slug can only contain letters, numbers, and hyphens'); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | // Check if slug is unique (exclude current trip when updating) |
| 201 | 201 | $existing = $this->repository->findBySlug($data['slug']); |
| @@ -275,10 +275,10 @@ | ||
| 275 | 275 | * Process before create |
| 276 | 276 | */ |
| 277 | 277 | protected function processBeforeCreate(array $data): array |
| 278 | 278 | { |
| 279 | - if (!preg_match('/^[a-z0-9-]+$/', $data['slug'])) { | |
| 280 | - throw new \InvalidArgumentException('Trip slug can only contain lowercase letters, numbers, and hyphens'); | |
| 279 | + if (!preg_match('/^[\pL\pN-]+$/u', $data['slug'])) { | |
| 280 | + throw new \InvalidArgumentException('Trip slug can only contain letters, numbers, and hyphens'); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | if (empty($data['status'])) { |
| 284 | 284 | $data['status'] = 'draft'; |
| @@ -1261,9 +1261,14 @@ | ||
| 1261 | 1261 | * Count departures by date |
| 1262 | 1262 | */ |
| 1263 | 1263 | public function countDeparturesByDate(int $tripId, string $date): int |
| 1264 | 1264 | { |
| 1265 | - return $this->repository->countDeparturesByDate($tripId, $date); | |
| 1265 | + // The December 2025 service/controller refactor moved this query to | |
| 1266 | + // TripAvailabilityRepository::countAvailableDeparturesByDate() but left | |
| 1267 | + // this call pointing at TripRepository, where no such method exists — | |
| 1268 | + // so the storefront's date-pricing request (fired whenever a customer | |
| 1269 | + // picks a date) has returned a fatal 500 ever since. | |
| 1270 | + return $this->availabilityRepository->countAvailableDeparturesByDate($tripId, $date); | |
| 1266 | 1271 | } |
| 1267 | 1272 | |
| 1268 | 1273 | /** |
| 1269 | 1274 | * Get trip with availability |