I wanted to insert data into table if the condition is met. Is there such things as this codes below?
DB::table('food')->insert([
'dessert' => $dessert1,
if(beverage == 1)
'drinks' => 1;
else if(beverage == 2)
'drinks' => 2;
]);
...