Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zap Laravel Package

laraveljutsu/zap

Zap adds flexible calendar scheduling to Laravel: manage resource availabilities, appointments, blocked times, and custom schedules (doctors, rooms, staff). Includes patterns plus querying/availability checks for booking, shifts, and shared spaces.

View on GitHub
Deep Wiki
Context7

Zap is a flexible scheduling and calendar package for Laravel that lets you model availabilities, appointments, blocked times, and custom schedules for any resource—doctors, rooms, employees, or shared spaces. It’s built for modern apps that need reliable booking logic, clear overlap rules, and easy querying.

Designed for real-world use cases like appointment booking, shift planning, and resource allocation, Zap helps you define when something can be booked and validate when it can’t—without reinventing scheduling from scratch.

  • Define availability windows, exceptions, and recurring patterns
  • Manage appointments and blocked periods with overlap handling
  • Make any Eloquent model schedulable via the HasSchedules trait
  • Query schedules and check availability for a given time range
  • Supports UUID/ULID model keys with configurable migrations
Frequently asked questions about Zap
How do I set up Zap for appointment booking in a Laravel app?
Install via Composer (`composer require laraveljutsu/zap`), publish the provider, run migrations, and add the `HasSchedules` trait to your model (e.g., `Doctor`). Then define availability windows, appointments, or blocked times using Zap’s fluent methods like `addAvailability()` or `blockTime()`.
Does Zap support recurring schedules like weekly or monthly appointments?
Yes, Zap includes 15+ recurrence rules (daily, weekly, monthly ordinals, custom intervals). Use methods like `recurs()->daily()->onWeekdays()` or `recurs()->monthly()->onLastDayOfMonth()` to define repeating schedules. All rules respect your app’s timezone.
Can I use Zap with UUIDs or ULIDs instead of integer primary keys?
Zap supports UUID/ULID but requires extra configuration. You’ll need to modify the migrations and update the `schedulable_id` column type in the `schedule_periods` table. The documentation provides a step-by-step guide for this setup.
How does Zap handle overlapping appointments or blocked times?
Zap provides built-in conflict detection with methods like `noOverlap()` and `maxDuration()`. When creating or querying schedules, it automatically checks for overlaps and enforces your rules. You can also customize overlap behavior for specific use cases.
What Laravel versions does Zap support, and is it compatible with PHP 8.5+?
Zap requires Laravel 13.0+ and PHP 8.5+. It’s designed for modern Laravel stacks and includes minimal version constraints. Always check the latest release notes for any breaking changes or new feature requirements.
Can I query available time slots for a resource (e.g., a doctor or meeting room)?
Yes, Zap offers methods like `getBookableSlots()` and `isBookableAtTime()` to check availability. You can also use `schedulesForDateRange()` to fetch all appointments or blocked times within a specific period, making it easy to build a frontend calendar.
Does Zap work with soft deletes in Laravel models?
No, Zap does not natively support soft deletes. If your models use `SoftDeletes`, you’ll need to extend the `Schedule` model to include soft delete logic manually. The package documentation provides guidance on implementing this workaround.
Are there any alternatives to Zap for Laravel scheduling?
Yes, alternatives include `spatie/laravel-schedule` (for cron jobs) or `spatie/laravel-calendar` (for event calendars). However, Zap is specialized for resource booking, appointment systems, and shift management with built-in overlap rules and recurrence patterns.
How do I test Zap’s scheduling logic in my Laravel app?
Use Laravel’s testing tools to create mock models with the `HasSchedules` trait, then test methods like `addAvailability()`, `blockTime()`, and `isBookableAtTime()`. You can also test recurrence rules by verifying schedules are generated correctly for edge cases like holidays or custom intervals.
Can Zap handle multi-resource dependencies (e.g., booking a room *and* an AV technician)?
Zap is designed for single-resource scheduling (e.g., a doctor, room, or employee). For multi-resource dependencies, you’ll need to implement custom logic, such as querying multiple models sequentially or using Laravel’s queue system to coordinate bookings across resources.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport