Managing complex schedules in Laravel just got a whole lot easier. Whether you're building an appointment booking system, employee shift manager, or event scheduler, Laravel Zap delivers a powerful, fluent API to handle time-based data with elegance and performance.
π What Is Laravel Zap?
Laravel Zap is a schedule management package built specifically for Laravel. It allows you to easily define and manage calendar-based events for your Eloquent modelsβthink meetings, recurring shifts, bookings, and more.
β¨ Example: Creating a Weekly Meeting
use Zap\Facades\Zap; $meeting = Zap::for($user) ->named('Team Standup') ->from('2025-01-01') ->to('2025-12-31') ->addPeriod('09:00', '09:30') ->weekly(['monday', 'wednesday', 'friday']) ->save();
This snippet defines a recurring meeting for a user, three times a week. The fluent API makes it feel like natural language.
π§ Smart Scheduling Features
With Zap, itβs not just about defining time blocks. The real power lies in querying availability, detecting conflicts, and generating smart time slots.
β Check Availability
$available = $user->isAvailableAt('2025-03-15', '14:00', '16:00');
π Get Open Time Slots
$slots = $user->getAvailableSlots( date: '2025-03-15', dayStart: '09:00', dayEnd: '17:00', slotDuration: 60 );
β οΈ Detect Schedule Conflicts
$conflicts = Zap::findConflicts($schedule);
π Fetch Daily Schedules
$todaySchedules = $user->schedulesForDate(today());
π Why Use Zap?
Zap combines Laravel-native elegance with robust scheduling logic. Hereβs why it stands out:
π Deep Laravel Integration
- Eloquent relationships (e.g.
User hasMany Schedules
) - Facades, service providers, config publishing
- Built-in Laravel events and validation
π§± Recurring + Custom Schedules
- Daily, weekly, monthly support
- Custom repeat rules
- Carbon-powered date/time handling with timezone support
π§ Conflict & Availability Engine
- Prevent overlapping bookings with conflict detection
- Define buffers between appointments
- Dynamically generate open slots
π§βπ» Built for Developers
Zap is built with a developer-first mindset:
- Fluent API for expressive code
- Well-tested, clean codebase
- Fully documented with usage examples
π οΈ Perfect For:
- π₯ Appointment Booking Systems
- π’ Meeting Room Schedulers
- π§ββοΈ Medical or Legal Practice Tools
- π Employee Shift Scheduling
- π Tutoring or Coaching Calendars
π¦ Installation & Docs
Install via Composer:
composer require zap/laravel
Then publish the config:
php artisan vendor:publish --tag=zap-config
Explore the full documentation to get started in minutes.
β‘οΈ Final Thoughts
Laravel Zap brings structure and intelligence to schedule management without leaving the Laravel ecosystem. With its elegant syntax and powerful features, you'll spend less time wrangling dates and more time building great experiences.