godkinmo
// ηζ₯ζι: δΈε 12:00 θ³ ζδΈ 21:30
\App\Store::find(2)
->update([
'timeslot_options' => collect(range(12, 21))
->map(function ($hour) {
return [
[
'from' => $hour . ":00",
'to' => $hour . ":15",
'max_count' => 5,
],
[
'from' => $hour . ":15",
'to' => $hour . ":30",
'max_count' => 5,
],
[
'from' => $hour . ":30",
'to' => $hour . ":45",
'max_count' => 5,
],
[
'from' => $hour . ":45",
'to' => ($hour + 1) . ":00",
'max_count' => 5,
],
];
})->flatten(1)->slice(0, -2)->toArray()
])
=> true