Laravel eloquent where error with <>

前端 未结 3 2362
栀梦
栀梦 2021-02-20 03:02

I have query for where in native php

where type <> \'point\'

and I try convert to eloquent laravel<

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 03:29

    You're using wrong syntax. Correct syntax for with() is:

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

提交回复
热议问题