model = $model ?? $this::resolveModel(); } public function filterBuilder($params): void { $this->item = static::getFilterBuilder($params); } /** * @throws BindingResolutionException * @throws Exception */ final protected function resolveModel(): AbstractRepository { $model = app()->make($this->model); if (!$model instanceof Model) { throw new Exception( "Class {$this->model} must be an instance of Illuminate\\Database\\Eloquent\\Model" ); } return (new static)->$model; } public function __call($name, $arguments) { $result = $this->forwardCallTo($this->model, $name, $arguments); if ($result === $this->model) { return $this; } return $result; } public function __get($name) { return $this->model->{$name}; } }