public function getBySlot($slot, Imageable $imageable = null) { if ($imageable) { $query = ImageModel::forImageable(get_class($imageable), $imageable->getKey()); } else { $query = ImageModel::unattached(); } return $query->inSlot($slot)->first(); }