Download the PHP package daliendev/laravel-zap-rrule without Composer
On this page you can find all versions of the php package daliendev/laravel-zap-rrule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daliendev/laravel-zap-rrule
More information about daliendev/laravel-zap-rrule
Files in daliendev/laravel-zap-rrule
Package laravel-zap-rrule
Short Description RRule (RFC 5545) add-on for the laravel-zap scheduling package
License MIT
Informations about the package laravel-zap-rrule
laravel-zap-rrule
RFC 5545 RRule support for laravel-zap.
Inspired by feat: rrule support #71 proposed by @shavonn.
Installation
No config changes needed. The service provider auto-discovers and wires everything.
Usage
All existing laravel-zap APIs (isBookableAt, getBookableSlots, forDate, …) work transparently with rrule schedules.
How it works
This package hooks into the three extension points laravel-zap exposes:
| Extension point | What we do |
|---|---|
config('zap.models.schedule') |
Swap in ZapRRule\Models\Schedule |
SafeFrequencyConfigCast |
Extend with RRuleAwareFrequencyConfigCast to deserialise frequency = 'rrule' rows |
'zap' container binding |
Rebind to our ScheduleService so Zap::for() returns our fluent builder (which has rrule()) |
The Eloquent query builder's forDate() scope is also extended to include rrule schedules in date queries; the per-occurrence check is delegated to RRuleFrequencyConfig::shouldCreateRecurringInstance() at the PHP level (same pattern used by laravel-zap for monthly_ordinal_weekday).
Custom Schedule model
If you already have a custom Schedule model, extend ours instead of the base:
Then set in config/zap.php:
Requirements
- PHP ≥ 8.2
laraveljutsu/laravel-zap^1.0rlanvin/php-rrule^2.6 (installed automatically)
License
MIT