if (a == 'умножить' || a == 'Умножить') {
} else if (a == 'разделить' || a == 'Разделить' ) {
}
<script src="/my/script.js?v=1"></script>
$exceptions = [];
foreach ($input as $value) {
try {
$output = Model::firstOrCreate($value);
} catch (Exception $e) {
$exceptions[] = $e->getMessage();
}
}
return response()->json(['error' => json_encode($exceptions)], 400);