public function scopeByDomain(Builder $query, ?Domain $domain = null): Builder 	{ 		return $query->where(function (Builder $query) use ($domain) { 			$query->whereNull('domain_id')->when($domain, function ($query) use ($domain) { 				$query->orWhere('domain_id', $domain->getKey()); 			}); 		}); 	}