Closed Xerzzh closed 2 years ago
Hi,
please try
$cover = Cover::whereIn('game', [$id1, $id2, $id3, /* ... */])->first();
instead.
whereIn
generates the correct query for your case.
Hi,
please try
$cover = Cover::whereIn('game', [$id1, $id2, $id3, /* ... */])->first();
instead.
whereIn
generates the correct query for your case.
Exactly! That was. It works!
Thank you!
Hello there,
I'm trying to get a cover list, but I can't get it correctly. If I make a request directly to the IGDB API I can get:
But when generating them from the Cover model, I can only get one, if I add several I get error:
syntax error, unexpected ','
Example code:
$cover = Cover::where('game', ($game->id_game_igdb, $game->id_game_igdb))->first();
What am I doing wrong?
Thanks.