protected function prepareModel()
    {
        if (!$this->model) {
            throw new MissingArgumentException('model property should be filled');
        }

        $this->model = new $this->model();

        $traits = class_uses_recursive(get_class($this->model));

        if (!isset($traits[Searchable::class])) {
            throw new InvalidArgumentException(get_class($this->model).' does not use the searchable trait');
        }
    }
protected function prepareModel()
    {
        if (!$this->model) {
            throw new MissingArgumentException('model property should be filled');
        }

        $this->model = new $this->model();

        $traits = class_uses_recursive(get_class($this->model));

        if (!isset($traits[Searchable::class])) {
            throw new InvalidArgumentException(get_class($this->model).' does not use the searchable trait');
        }
    }
protected function prepareModel ( ) { if ( ! $ this -> model ) { throw new MissingArgumentException ( 'model property should be filled' ) ; } $ this -> model = new $ this -> model ( ) ; $ traits = class_uses_recursive ( get_class ( $ this -> model ) ) ; if ( ! isset ( $ traits [ Searchable :: class ] ) ) { throw new InvalidArgumentException ( get_class ( $ this -> model ) . ' does not use the searchable trait' ) ; } }
Validate the given model and create a new instance.
Validate the given model and create a new instance .