BadMethodCallException in Macroable.php line 74: Method orWhere does not exist.
$category = $categories->where('Node_ID', (explode('.', $cat{$title_id})[0]))
->orWhere('Node_Path', $cat->{$category_name})
->first();
If I try without "orWhere" works, if I use it, throws an Error. Someone knows where is the mistake?
You are trying to use orWhere
on collections, thats why its showing you the error. You should use this on model like this (taking Category
as a Model):
$category = Category::where('Node_ID', (explode('.', $cat{$title_id})[0]))
->orWhere('Node_Path', $cat->{$category_name})
->first();
See Laravel Docs for
orWhere()
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With