public function scopeByMarket(Builder $query, ?Market $market = null): Builder 	{ 		return $query->where(function (Builder $query) use ($market) { 			$query->whereNull('market_id')->when($market, function ($query) use ($market) { 				$query->orWhere('market_id', $market->getKey()); 			}); 		}); 	}