Laravel 方法Illumb\Database\Eloquent\Collection::orWhere不存在

Laravel 方法Illumb\Database\Eloquent\Collection::orWhere不存在,laravel,laravel-5,eloquent,Laravel,Laravel 5,Eloquent,我遇到了问题方法illumb\Database\elounce\Collection::or其中不存在。我只想在那个案子上用orWhere 我尝试在上一个查询中添加->get(),但仍然出错 $category = Auth::user()->division->allCode->where('parent', '0')->where('info_code', 'code_h') ->orWhere('info_code','=', 'cod

我遇到了问题方法
illumb\Database\elounce\Collection::or其中不存在
。我只想在那个案子上用orWhere

我尝试在上一个查询中添加
->get()
,但仍然出错

$category = Auth::user()->division->allCode->where('parent', '0')->where('info_code', 'code_h')
            ->orWhere('info_code','=', 'code_m')->where('parent', '0');
在这种情况下,我想使用或在何处获得结果。这是我想要的逻辑

(parent==0 && info_code == code_h) || (parent==0 && info_code == code_m)

在所有代码之后使用
()
,例如:
Auth::user()->division->allCode()->where…
在所有代码之后使用
()
,例如:
Auth::user()->division->allCode()->where…
我不明白这一点。你能教我吗?我有这个问题$notifications=Auth::user()->notifications->where('type','App\notifications\UserUpdate')->或者where('type','App\notifications\postapdate')->take(10)<代码>“方法照亮\\通知\\数据库通知集合::或不存在的位置。”
调用方法将提供许多类,您可以继续修改查询。如果调用与关系方法同名的道具;这类似于notifications()->get(),它将返回一个模型集合,而不是查询生成器。因为模型集合也有像生成器一样的where方法,所以在orWhere调用中会出现错误。我不明白这一点。你能教我吗?我有这个问题$notifications=Auth::user()->notifications->where('type','App\notifications\UserUpdate')->或者where('type','App\notifications\postapdate')->take(10)<代码>“方法照亮\\通知\\数据库通知集合::或不存在的位置。”
调用方法将提供许多类,您可以继续修改查询。如果调用与关系方法同名的道具;这类似于notifications()->get(),它将返回一个模型集合,而不是查询生成器。因为模型集合也有像builder一样的where方法,所以在orWhere调用中会出现错误。