Is there a simple way to get media by id?
getMedia method has a 2nd parameter for filtering
Tried this one but it's not good:
$primary_image = $this->getMedia('images', [ 'id' => 44 ])->first();
Thanks
Got it, my solution is:
$images = $this->getMedia('images');
$image = $images->where('id', $this->primaryMediaId)->first();
Just chain it.
$images = $this->getMedia('images')->where('id', $this->primaryMediaId);
Most helpful comment
Got it, my solution is: