How to get the company logo
Askancy opened this issue ยท 1 comments
Askancy commented
Hi I would need to receive the publisher/developer logo, I currently have the query:
$game = Game::with(['cover' => ['url', 'image_id'],
'screenshots' => ['url', 'image_id','height','width'],
'artworks' => ['url', 'image_id'],
'videos' => ['video_id', 'name'],
'involved_companies', 'involved_companies.company'
])->where('slug', $value)->first();
I get this Company, for example:
as you can see in the logo I have the id โ1354โ. reading the documentation I found company_logos, but I don't understand how to use it.
I tried adding: 'company_logos' => ['url', 'image_id.company']
could you give me an example of how can I get the url of the logo? thank you very much
marcreichel commented
Hi @Askancy,
there was a little bug in version 2.4.3 for generating where clauses. You may update to the latest version to get rid of the bug ๐๐ผ
To get the logo url of a company simply add the logo to the expand (with
) clause like this:
$game = Game::with([
'cover' => ['url', 'image_id'],
'screenshots' => ['url', 'image_id','height','width'],
'artworks' => ['url', 'image_id'],
'videos' => ['video_id', 'name'],
'involved_companies',
'involved_companies.company',
+ 'involved_companies.company.logo',
])->where('slug', $value)->first();