I really don't understand your question... What do you want to achieve? Something like a switch?
Dec 30, 2015
3
Level 25
Update Value based on the Input
Hi,
Am having a table with three column,
| condition | col1 | col2 |
|-------------|-------------|-------------|
|A |yes |no |
|B |no |yes |
|B |no |yes |
|A |yes |no |
The input will be either A or B. If the input is A then we need to update the column 'col1' to yes and 'col2' to no and vice-versa.
At present am using two queries to perform this operation like,
tablename::where($request->input,'A')->update(['col1'=>'yes','col2'=>'no']);
tablename::where($request->input,'B')->update(['col2'=>'yes','col1'=>'no']);
Please or to participate in this conversation.