marcreichel/igdb-laravel

Help with platform filter

Closed this issue · 2 comments

Hello,

I did not found an example for my needs.

I would like to get a total games of Playstation 2 and a list of games.

  1. I tryed get total with this code, but platform is a relation and did not work:

$platforms_games_total = Game::where('platforms', '28')->count();

I'm receiving Null as return.

  1. I tryed get a list of playstation 2 games, but this also did not work:

$games = Game::where('platforms', '28')->get();

Could you help me?

Best regards.

@jadersilvabr the count() method is broken. I've done a pull request to fix it (#24).

The ID for "Playstation 2" is 8, not 28 (which doesn't exist).

The following returns results:

$games = Game::where('platforms', 8)->get();

Hi @scottcharlesworth

Sorry for my confusion with ID.

I did some tests now and all is working fine.

Ps: The count() method working fine after fix #24.

Best regards.