laravel-scout-tntsearch-driver: Declaration of TeamTNT\Scout\Engines\TNTSearchEngine::map($results, $model) must be compatible with Laravel\Scout\Engines\Engine::map(Laravel\Scout\Builder $builder, $results, $model)
Declaration of TeamTNT\Scout\Engines\TNTSearchEngine::map($results, $model) must be compatible with Laravel\Scout\Engines\Engine::map(Laravel\Scout\Builder $builder, $results, $model)
I am receiving this exception when calling search() on a model.
I have temporarily fixed this by changing the signature of the map function from
public function map($results, $model)
to
public function map(Builder $builder, $results, $model)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 18 (6 by maintainers)
Commits related to this issue
- allow query callback — committed to laravel/scout by taylorotwell 6 years ago
just created another release v3.1.0 that will force laravel scout 5.0.*, so the error should be gone
Update: Downgrading to Scout v4.* works.
On composer json:
Then:
@Krato already fixed it in the master, but there is no release yet. You can require it with
i ran composer update and it installed v3.0.8 but i still get the error. maybe there’s something else i’m supposed to do?
@nticaric v3.1.0 will cause another problem
@bradley-varol This kind of error was mentioned here https://github.com/teamtnt/laravel-scout-tntsearch-driver/issues/56
I’ve updated to
v3.0.8but I’m still receiving this error when saving or creating a searchable model 😭Same for me. (New user here!) Will be this fixed soon? I have a deadline and I need to know if can I use this package. Thanks. 😄
Edit: I have found the breaking change in Laravel Scout: https://github.com/laravel/scout/commit/9f06b9c4d77879d53cf1680740b7f8bf19f78279#diff-c0a1ec7dbf011155e6c41c1f05d39fffR60
Okay when creating a model I have used
search()in I’m receiving:Also worth noting that
php artisan scout:import \App\ModelNamedidn’t work but during setup butphp artisan tntsearch:import \App\ModelNamedid.