- How do I generate an iCalendar (.ics) file for a Laravel event using kigkonsult/icalcreator?
- Use the fluent API to create a VEVENT component, set properties like DTSTART, DTEND, SUMMARY, and attach it to a VCALENDAR. Save the output as a string or file. Example: `$vcalendar->newEvent()->setDtStart($dateTime)->setSummary('Meeting');` then `$vcalendar->save()`.
- Does this package support recurring events (RRULE) in Laravel?
- Yes, it fully supports RRULEs for recurring events, including exceptions (EXDATE) and complex recurrence patterns. Use methods like `setRRule()` with valid RFC 5545 syntax. Test edge cases (e.g., overlapping exceptions) in your Laravel tests.
- Can I use this package to parse existing .ics files in Laravel?
- No, this package is a generator only. For parsing, pair it with a library like `sabre/vobject` or `php-ical`. The package focuses on creating RFC-compliant .ics files, not reading them.
- What Laravel versions and PHP versions does kigkonsult/icalcreator support?
- The package supports PHP 8.x (stable) and PHP 7.x (legacy). Laravel compatibility depends on your PHP version—use `^2.40` for PHP 8 or `^2.39` for PHP 7 in `composer.json`. No Laravel-specific dependencies exist.
- How do I integrate iCalendar generation with Laravel Eloquent models?
- Map Eloquent attributes (e.g., `start_at`, `end_at`, `title`) to iCalendar properties in a service class. Use accessors/mutators to serialize events to .ics strings or store them as text blobs in the database.
- Is this package suitable for high-volume calendar exports (e.g., 10,000+ events)?
- Performance is generally acceptable for most use cases, but benchmark large exports. For bulk operations, generate .ics files asynchronously via Laravel queues to avoid timeouts or memory issues.
- How do I handle time zones in Laravel with this package?
- Use PHP’s `DateTimeZone` (aligned with Laravel’s built-in support) and populate VTIMEZONE components with `vtimezonePopulate()`. Ensure timezone identifiers match those in your Laravel config (e.g., `America/New_York`).
- Can I customize or extend iCalendar properties (e.g., X-PROP) in Laravel?
- Yes, the package supports custom properties via `addProperty()` or `setXProperty()`. This is useful for vendor-specific extensions or non-standard fields, though validate RFC compliance for interoperability.
- What are the alternatives to kigkonsult/icalcreator for Laravel?
- Alternatives include `sabre/vobject` (bidirectional parsing/generation) or `php-ical` (simpler but less RFC-compliant). For JSON-based calendars, consider `PhpJsCalendar`. Choose based on whether you need parsing or just generation.
- How do I validate generated .ics files for RFC compliance in Laravel?
- Use online validators like [icalendar.org](https://icalendar.org/) or integrate a PHP validator (e.g., `icalendar-validator`). Test edge cases like invalid RRULEs or malformed DTSTAMP values in your Laravel test suite.