laravel-cross-eloquent-search icon indicating copy to clipboard operation
laravel-cross-eloquent-search copied to clipboard

Full text search throught relationship with string ID

Open japafrite opened this issue 5 months ago • 0 comments

Hi, When relationship is with string id, it cannot work

return Search::addFullText(Model::class,
	[
                            'id',
                            'name',
                            'town' => ['name', 'postcode'],
                        ],
	['mode' => 'boolean']
)
->search($seek);

With relation belongs to on Model by town_id and id that is a string

Error is

ProtoneMedia\LaravelCrossEloquentSearch\ModelToSearchThrough::setFullTextRelation(): Argument #1 ($fullTextRelation) must be of type ?string, int given, called in /home/sc1hjny5024/public_html/script_dev11/vendor/protonemedia/laravel-cross-eloquent-search/src/ModelToSearchThrough.php on line 246

japafrite avatar Jun 02 '25 06:06 japafrite