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
I have got an issue when I try to integrate Laravel Scout to model which also has integrated yours EagerLoadPivotTrait. $recipes = Recipe::with('foodmenus')->search($request->search)->whereHas('foodmenus', function (Builder $query) use ($clientPrograms) { $query->whereIn('id', $clientPrograms); $query->latest(); })->get();
When this code block is executing I got an error: Call to undefined method AjCastro\\EagerLoadPivotRelations\\EagerLoadPivotBuilder::search()
In Recipe model I use these traits:
<?php
namespace App\Models;
use App\Services\Foodmenus\NutritionCalculator;
use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;
use Brackets\Media\HasMedia\ProcessMediaTrait;
use Brackets\Media\HasMedia\AutoProcessMediaTrait;
use Brackets\Media\HasMedia\HasMediaCollectionsTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Brackets\Media\HasMedia\HasMediaThumbsTrait;
use Carbon\Carbon;
use AjCastro\EagerLoadPivotRelations\EagerLoadPivotTrait;
use Laravel\Scout\Searchable;
class Recipe extends Model implements HasMedia
{
use Searchable;
use ProcessMediaTrait;
use AutoProcessMediaTrait;
use HasMediaCollectionsTrait;
use HasMediaThumbsTrait;
use EagerLoadPivotTrait;
...
Can you please tell me what cause this issue and how to solve it?
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
I have got an issue when I try to integrate Laravel Scout to model which also has integrated yours EagerLoadPivotTrait.
$recipes = Recipe::with('foodmenus')->search($request->search)->whereHas('foodmenus', function (Builder $query) use ($clientPrograms) { $query->whereIn('id', $clientPrograms); $query->latest(); })->get();
When this code block is executing I got an error:
Call to undefined method AjCastro\\EagerLoadPivotRelations\\EagerLoadPivotBuilder::search()
In Recipe model I use these traits:
Can you please tell me what cause this issue and how to solve it?
Thanks.
The text was updated successfully, but these errors were encountered: