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