public function scopeAttached(Builder $query) { return $query->whereNotNull('imageable_id')->whereNotNull('imageable_type'); }