Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

fix: Cast page and per_page to int in QueryParamsDTO (#1113)

Dave Earley7f78feb2fa0f
diff --git a/backend/app/Http/DTO/QueryParamsDTO.php b/backend/app/Http/DTO/QueryParamsDTO.php
index 6e351bd91..cc0c8d83d 100644
--- a/backend/app/Http/DTO/QueryParamsDTO.php
+++ b/backend/app/Http/DTO/QueryParamsDTO.php
@@ -35,8 +35,8 @@ class QueryParamsDTO extends BaseDTO
}
return new self(
- page: $data['page'] ?? 1,
- per_page: $data['per_page'] ?? 25,
+ page: isset($data['page']) ? (int)$data['page'] : 1,
+ per_page: isset($data['per_page']) ? (int)$data['per_page'] : 25,
sort_by: $data['sort_by'] ?? null,
sort_direction: $data['sort_direction'] ?? null,
query: $data['query'] ?? null,