I am trying to update the table.
I have all values in foreach. The unique id is 'uuid'
But I would like to update if the value has been changed only. I tried to do this but no luck.
$results = DB::table('urls')
->where('uuid','=',$uuid)
->orWhere('id_media', '!=',$id_media)
->orWhere('region', '!=',$region)
->orWhere('page', '!=',$page)
->orWhere('audience', '!=',$audience)
->update(array(
'id_media' => $id_media,
'region'=>$region,
'page'=>$page,
'audience'=>$audience
));
what would be the laravel way for below query.
update my_table set
my_col = 'newValue'
where id = 'someKey'
and my_col != 'newValue';