Laravel Zap logo
Guides

Configuration & Advanced

Customize Zap and use advanced features.

Configuration

Publish and customize the configuration file:

php artisan vendor:publish --tag=zap-config

Key settings in config/zap.php:

use Carbon\CarbonInterface;

return [
    'calendar' => [
        'week_start' => CarbonInterface::MONDAY,  // Week start day for bi-weekly calculations
    ],

    'time_slots' => [
        'buffer_minutes' => 0,  // Default buffer between slots
    ],

    'default_rules' => [
        'no_overlap' => [
            'enabled' => true,
            'applies_to' => ['appointment', 'blocked'],
        ],
    ],
];

Advanced Features

Custom Schedules with Explicit Rules

Zap::for($user)
    ->named('Custom Event')
    ->custom()
    ->from('2025-01-15')
    ->addPeriod('15:00', '16:00')
    ->noOverlap()  // Explicitly prevent overlaps
    ->save();

Metadata Support

Attach arbitrary data to any schedule:

->withMetadata([
    'patient_id' => 1,
    'type' => 'consultation',
    'notes' => 'Follow-up required'
])