Running a whereHas method off a hasMany relation blows up with:
ErrorException: compact(): Undefined variable: operator in file /var/www/testproject/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php on line 1243
$result = $parentModel->manyRelation()->whereHas('childOtherRelation', function ($query) use ($value) {
$query->where('name', '=', $value);
})->firstOrFail();
Looking at the chunk of code (addWhereExistsQuery in Query/Builder.php), I'm not seeing where $operator ever got defined.
This will be fixed in the next release.
Sweet, thank you.
That's running clean now.
Just:
composer update
Just:
composer update
you ruined my project. @ahlechandre
Just:
composer update
you ruined my project. @ahlechandre
git checkout composer.lock
composer install
@dyusip Thanks, it worked for me.
Can you answer why?
Most helpful comment
Just: