Download the PHP package vincenzoraco/recurrences without Composer
On this page you can find all versions of the php package vincenzoraco/recurrences. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vincenzoraco/recurrences
More information about vincenzoraco/recurrences
Files in vincenzoraco/recurrences
Package recurrences
Short Description A Laravel package for managing recurring events using the RFC 5545 RRULE specification
License MIT
Homepage https://github.com/vincenzoraco/recurrences
Informations about the package recurrences
Laravel Recurrences
A Laravel package for managing recurring events using the RFC 5545 RRULE specification. Built on top of rlanvin/php-rrule, this package provides a Laravel-native interface for working with recurring dates and events.
Why this package?
While the bare rlanvin/php-rrule library is powerful, this package offers significant advantages for Laravel applications:
- Eloquent Integration: Attach recurrence conditions to any Eloquent model using a simple trait
- Type-Safe Data Objects: All configuration is done through typed data objects with validation
- Laravel Events: Dispatchable events for when recurrence conditions are created, updated, or deleted
- MorphMany Relationship: Attach multiple recurrence rules to any model without creating additional tables
- Facade Access: Convenient facade for accessing the service layer
- Occurrence Hashing: Built-in utilities for generating unique hashes for occurrences (useful for caching)
- Exclusion Support: Easily exclude specific dates or date ranges from recurring events
Installation
You can install the package via composer:
Usage
Making a model recurrable
Add the HasRecurrences trait and Recurrable contract to any Eloquent model:
Creating a recurring event
Use the data objects to define recurrence conditions:
Filtering by weekday
Restrict a recurring event to specific days of the week using the RecurringWeekDay enum:
Creating a one-time occurrence
Add single dates to a recurrable model:
Excluding dates from a recurring event
Exclude specific dates or date ranges:
Getting occurrences
Retrieve occurrences from a recurrable model:
Getting occurrences directly from a model
A shorthand to build the RSet and query occurrences in one call:
Deleting all conditions
Remove every recurrence condition attached to a model:
Using the facade
Using the facade alias
Configuration
Publish the config file:
Available configuration options:
Available Frequencies
RecurringFrequency::DAILYRecurringFrequency::WEEKLYRecurringFrequency::MONTHLYRecurringFrequency::YEARLY
Available Week Days
RecurringWeekDay::MONDAYRecurringWeekDay::TUESDAYRecurringWeekDay::WEDNESDAYRecurringWeekDay::THURSDAYRecurringWeekDay::FRIDAYRecurringWeekDay::SATURDAYRecurringWeekDay::SUNDAY
Ending Conditions
NoEndingConditionDataObject- Never endsEndingConditionUntilDataObject- Ends on a specific dateEndingConditionTimesDataObject- Ends after a specific number of occurrences
Events
The package dispatches Laravel events for lifecycle hooks:
RecurringConditionCreatedEventRecurringConditionUpdatedEventRecurringConditionDeletedEvent
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email vincenzo [at] vincenzoraco.dev instead of using the issue tracker.
Credits
- Vincenzo Raco
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of recurrences with dependencies
illuminate/support Version ^v11.0|^v12.0|^v13.0
rlanvin/php-rrule Version ^2.5