method = $method; $this->builder = $builder; } /** * Proxy a scope call onto the query builder. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { return $this->builder->{$this->method}(function ($value) use ($method, $parameters) { return $value->{$method}(...$parameters); }); } }