Laravel Zap logo
Guides

Query & Check

How to check availability and retrieve schedules.

Query & Check

Check Availability

!warningisAvailableAt() is deprecated in favor of isBookableAt() and getBookableSlots(). Use the bookable APIs for all new code.

// Check if the doctor has at least one bookable slot on this date
$doctor->isBookableAt('2025-01-15');

// Find conflicts
$conflicts = Zap::findConflicts($schedule);
$hasConflicts = Zap::hasConflicts($schedule);

Retrieve Schedules

// Query schedules
$doctor->schedulesForDate('2025-01-15')->get();
$doctor->schedulesForDateRange('2025-01-01', '2025-01-31')->get();

// Filter by type
$doctor->appointmentSchedules()->get();
$doctor->availabilitySchedules()->get();
$doctor->blockedSchedules()->get();

Inspect Schedule

// Check schedule type
$schedule->isAvailability();
$schedule->isAppointment();
$schedule->isBlocked();