The expression return $this->model->get...rd::getEsDefaultIndex() could return the type Illuminate\Database\Eloquent\Builder which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
The expression return $this->type ?: $t...odel->getDocumentType() could return the type Illuminate\Database\Eloquent\Builder which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.