Laravel雄辩地说错误与<>

Muh*_*nto 8 php mysql laravel eloquent

我有查询,其中在本地的PHP

其中type <>'point'

我尝试转换为雄辩的 laravel

 ->with('payments',function($query){
      $query->where('type','<>','point');
 })
Run Code Online (Sandbox Code Playgroud)

但它显示错误如下:

mb_strpos()期望参数1是字符串,给定对象

Ale*_*nin 31

你使用了错误的语法.正确的语法with()是:

->with(['payments' => function ($query) {
    $query->where('type', '<>', 'point');
}])
Run Code Online (Sandbox Code Playgroud)