Laravel eloquent where error with <>

前端 未结 3 1974
粉色の甜心
粉色の甜心 2021-02-20 03:22

I have query for where in native php

where type <> \'point\'

and I try convert to eloquent laravel<

3条回答
  •  旧时难觅i
    2021-02-20 03:26

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

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

提交回复
热议问题