You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running php artisan scout:import or php artisan scout:reimport on a Pivot Model (Illuminate\Database\Eloquent\Relations\Pivot) that implements shouldBeSearchable() generates an Exception because Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php::newQueryForCollectionRestoration (289) requires an array starting with $ids[0] and shouldBeSearchable() after filtering gives an array starting with an index greater than zero.
Steps To Reproduce:
I've created an fresh Laravel app with 3 models Company, Product and CompanyProductPivot + Scout with Algolia in order to reproduce the error.
Description:
Running
php artisan scout:import
orphp artisan scout:reimport
on a Pivot Model (Illuminate\Database\Eloquent\Relations\Pivot
) that implementsshouldBeSearchable()
generates an Exception becauseIlluminate/Database/Eloquent/Relations/Concerns/AsPivot.php::newQueryForCollectionRestoration (289)
requires an array starting with $ids[0] andshouldBeSearchable()
after filtering gives an array starting with an index greater than zero.Steps To Reproduce:
I've created an fresh Laravel app with 3 models Company, Product and CompanyProductPivot + Scout with Algolia in order to reproduce the error.
storage/logs/laravel.log
.Failed artisan scout:import (using shouldBeSearchable):
Failed Queue log
Success
artisan scout:import
(without shouldBeSearchable/filtering):The text was updated successfully, but these errors were encountered: