remeritus / livewire-rrule-generator
Generates RRule string using Livewire.
Fund package maintenance!
remeritus
Requires
- php: ^8.1
- laravel/framework: ^11.0
- livewire/livewire: ^3.4
- rlanvin/php-rrule: ^2.3
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-laravel: ^2.0
- phpunit/phpunit: ^10.3.5
- spatie/laravel-ray: ^1.26
README
Livewire Rrule Generator is a GUI for rlanvin/php-rrule
. It generates RRULE
from RFC 5545 complaint strings that can be used to manage recurring events.
Functionality is limited to Daily/Weekly/Monthly/Yearly rrules and GUI mimics Google Calendar approach.
Installation
You can install the package via composer:
composer require remeritus/livewire-rrule-generator
You can publish the config file with:
php artisan vendor:publish --tag="livewire-rrule-generator_without_prefix-config"
This is the content of the published config file:
return [ 'title' => 'Define Schedule', 'includeWeekend' => TRUE, 'frequencies' => [ 'DAILY' => TRUE, 'WEEKLY' => TRUE, 'MONTHLY' => TRUE, 'YEARLY' => TRUE, ], 'defaultView' => 'WEEKLY', 'weekStarts' => 'MO', ];
Setup
TailwindCSS
Add these additional lines into your tailwind.config.js file:
// use `purge` instead of `content` if using TailwindCSS v2.x content: [ './vendor/remeritus/livewire-rrule-generator/resources/views/**/*.blade.php', // etc... ]
Usage
In your views
If you want to create new Rrule string
<livewire:rrule-generator/>
If you want to edit existing Rrule string
If you want to edit existing RRule you can pass it to rrule-string
<livewire:rrule-generator rrule-string='FREQ=WEEKLY;COUNT=30;INTERVAL=1' />
Accessing RRule String
- There is an
<input type="hidden" ... name="rrule_string"/>
from which you can extract the RRule String. So if you place<livewire:rrule-generator/>
within a form it will be part of the forms data. - You can also listen to livewire event
rruleCreated
, which emits RRule String on Rrule's creation.
Credits
License
The MIT License (MIT). Please see License File for more information.