Schedule Patterns
Date Ranges
from(), to(), between(), forYear() — define when a schedule is valid.
Date Ranges
Define the validity period of a schedule: when it starts and (optionally) when it ends.
$schedule = Zap::for($doctor)
->named('Office Hours')
->availability();
// Single date (no end)
$schedule->from('2025-01-15');
// Alternative: on() is an alias for from()
$schedule->on('2025-01-15');
// Date range
$schedule->from('2025-01-01')->to('2025-12-31');
// Alternative syntax
$schedule->between('2025-01-01', '2025-12-31');
// Entire year shortcut
$schedule->forYear(2025);
Use these after choosing a recurrence (e.g. weekly(), monthly()) and before or after addPeriod(), then call save().
