marcreichel / igdb-laravel

Simplify the integration of the IGDB API into your Laravel app. Including IGDB webhook support.
https://marcreichel.dev/docs/igdb-laravel
MIT License
107 stars 22 forks source link

Platform Logos #50

Closed HDVinnie closed 3 years ago

HDVinnie commented 3 years ago

Using latest version.

>>> collect($meta->platforms)->pluck('id');
=> Illuminate\Support\Collection {#5386
     all: [
       6,
       48,
       49,
       130,
     ],
   }
>>> MarcReichel\IGDBLaravel\Models\PlatformLogo::whereIn('id', [collect($meta->platforms)->pluck('id')])->get();
Illuminate\Http\Client\RequestException with message 'HTTP request returned status code 500:
{
    "title": "Internal server error",
    "status": 500,
    "type": "https://javalin.io/documentation#internalservere (truncated...)
'
marcreichel commented 3 years ago

This may was a temporary problem with the IGDB API as I tested it just now and it is working fine. I reproduced your scenario with the following code:

$platforms = collect([['id' => 6], ['id' => 48], ['id' => 49], ['id' => 130]])->pluck('id');
MarcReichel\IGDBLaravel\Models\PlatformLogo::whereIn('id', $platforms->toArray())->get();