how to write like this. this function is not working for me
ContractorsServices::where('serviceID',$request->id)->where('isPopular', false)->update([
'isPopular' => true
]);
CodePudding user response:
try doing it this way
ContractorsServices::where(['serviceID' => $request->id, 'isPopular' => 'false'])
->update([
'isPopular' => true
]);
CodePudding user response:
use:
ContractorsServices::where([
['serviceID',$request->id],
['isPopular', false]
])
->update([
'isPopular' => true
]);
if not work, check data is correct or not:
$ContractorsServices = ContractorsServices::where([
['serviceID',$request->id],
['isPopular', false]
])->get();
return $ContractorsServices;