public function scopeForImageable(Builder $query, $type, $id) { return $query->where('imageable_type', $type)->where('imageable_id', $id); }