Guides
Query & Check
How to get bookable slots, check availability, and retrieve schedules.
Query & Check
This page answers: How do I get bookable slots? How do I check if a time is free? How do I list schedules for a date? For defining when a resource can be booked, see Schedule patterns and Quick start.
I want to…
| Goal | Method / API |
|---|---|
| Know if there is any bookable slot on a date | $model->isBookableAt('2025-01-15', 60) or isBookableAt('date', duration, bufferMinutes) |
| Check if a specific time range is free | $model->isBookableAtTime('2025-01-15', '09:00', '10:00') |
| List all bookable slots for a date | $model->getBookableSlots('2025-01-15', 60, 15) |
| Find the next available slot | $model->getNextBookableSlot('2025-01-15', 60, 15) |
| List schedules on a date | $model->schedulesForDate('2025-01-15')->get() |
| List schedules in a date range | $model->schedulesForDateRange('2025-01-01', '2025-01-31')->get() |
| Check for overlapping schedules (conflicts) | Zap::findConflicts($schedule) / Zap::hasConflicts($schedule) |
| Filter by type (appointment, availability, blocked) | $model->appointmentSchedules(), availabilitySchedules(), blockedSchedules() |
Deprecation:
isAvailableAt() is deprecated. Use isBookableAt(), isBookableAtTime(), or getBookableSlots() for all new code.Check availability (bookable slots)
// Check if there is at least one bookable slot on the day
$isBookable = $doctor->isBookableAt('2025-01-15', 60);
// With buffer between slots (e.g. 15 minutes)
$isBookable = $doctor->isBookableAt('2025-01-15', 60, 15);
// Check if a specific time range is bookable
$isBookable = $doctor->isBookableAtTime('2025-01-15', '09:00', '10:00');
// Get all bookable slots (date, slot duration in minutes, buffer in minutes)
$slots = $doctor->getBookableSlots('2025-01-15', 60, 15);
// Find the next available slot (from date, duration, optional buffer)
$nextSlot = $doctor->getNextBookableSlot('2025-01-15', 60, 15);
Conflicts
$conflicts = Zap::findConflicts($schedule);
$hasConflicts = Zap::hasConflicts($schedule);
Retrieve schedules
// By date or range
$doctor->schedulesForDate('2025-01-15')->get();
$doctor->schedulesForDateRange('2025-01-01', '2025-01-31')->get();
// By type: appointment, availability, blocked
$doctor->appointmentSchedules()->get();
$doctor->availabilitySchedules()->get();
$doctor->blockedSchedules()->get();
Inspect a schedule
$schedule->isAvailability();
$schedule->isAppointment();
$schedule->isBlocked();
