diff --git a/src/Concerns/Search/HasModel.php b/src/Concerns/Search/HasModel.php index 78ea873..779d9d3 100644 --- a/src/Concerns/Search/HasModel.php +++ b/src/Concerns/Search/HasModel.php @@ -85,30 +85,6 @@ protected function getRelationship() return $this->relationship; } - /** - * Resolve the model for the current context. - * - * @return void - * - * @throws \Ramadan\EasyModel\Exceptions\InvalidModel - */ - protected function resolveModel() - { - // We will check if the model has been set using the "setSearchableModel" method - // as a manual setting is more of a priority otherwise it means the developer uses - // the "Searchable" trait in the model itself. - if (!empty($this->getSearchableModel())) { - return; - } - - if (is_a(self::class, Model::class, true)) { - $this->setSearchableModel(self::class); - return; - } - - throw new InvalidModel("Cannot resolve the searchable model."); - } - /** * Apply the scopes to the query. * diff --git a/src/Searchable.php b/src/Searchable.php index 7c61310..ccffff5 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -229,8 +229,6 @@ public function addOrWhereRelation(array $wheres, EloquentBuilder $query = null) */ protected function getSearchableEloquentBuilder() { - $this->resolveModel(); - $model = $this->getSearchableModel(); $relationship = $this->getRelationship();