improvements on the games list page, better design and grid/card/list views

This commit is contained in:
Doar Mihai
2026-02-28 13:53:23 +02:00
parent 29b5eca900
commit 90f492808c
5 changed files with 339 additions and 41 deletions
+14 -3
View File
@@ -17,8 +17,11 @@ use MarcReichel\IGDBLaravel\Models\Platform as IgdbPlatform;
class IgdbService
{
public function get(int $limit)
{
public function get(
int $limit,
$startDate = null,
$endDate = null,
) {
try {
$existingIds = $this->getExistingIds();
@@ -38,10 +41,18 @@ class IgdbService
// ->where('category', '=', 0)
;
if ($startDate) {
$queryBuilder->where('first_release_date', '>=', $startDate);
}
if ($endDate) {
$queryBuilder->where('first_release_date', '<=', $endDate);
}
if (!empty($existingIds)) {
// Convert array of quoted strings to array of integers
// $existingIds = array_map(function($id) {
// return (int)str_replace('"', '', $id);
// return (int)str_replace('"', '', $id);
// }, $existingIds);
$queryBuilder->whereNotIn('id', $existingIds);
}