How to do update query on laravel fluent using db::raw

后端 未结 3 1987
故里飘歌
故里飘歌 2020-12-14 15:11

This is related to one of my question earlier where:

Update table1 field with table2 field value in join laravel fluent

But since this is a different approac

3条回答
  •  鱼传尺愫
    2020-12-14 15:54

    And will be work such similar, simple realization in Laravel 5.2 , Query Builder:

    DB::table('stores')
                ->where('id', $request)
                ->update(['visibility' =>DB::raw($value)]);
    

    This response is tested real site and working properly

提交回复
热议问题