Form field
use Andreia\FilamentRecurrence\Forms\Components\RecurrenceField;
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('title')->required(),
RecurrenceField::make('recurrence')
->showStartDate()
->showEndOptions()
->useDateTime(), // Use DateTimePicker instead of DatePicker
]);
}
Form field options
| Method | Effect |
|---|---|
->showStartDate(bool $show = true) | Show/hide the start date picker |
->showEndOptions(bool $show = true) | Show/hide end options (never, until, count) |
->showPreview(bool $show = true) | Show/hide the live preview (human-readable rule + next occurrences). Default true |
->previewOccurrencesLimit(int $limit) | How many “next occurrences” rows appear in the preview. Default 5 |
->useDateTime(bool $use = true) | Use a datetime picker instead of a date picker |
->showTimezone(bool $show = true) | Show/hide the per-record timezone select. Default true — when false, the config timezone is always used |
->showAdvancedOptions(bool $show = true) | Show advanced recurrence options |
->nullable(array $fields = null) | Allow start date, frequency, and timezone to be empty (empty recurrence is stored as null). Pass fields to make only specific fields nullable, e.g. ->nullable(fields: ['timezone']) |
// Hide the preview (full-width form only)
RecurrenceField::make('recurrence')->showPreview(false);
// Use only config('filament-recurrence.timezone') for every record (hide the timezone field)
RecurrenceField::make('recurrence')->showTimezone(false);
// Show 10 upcoming dates in the preview
RecurrenceField::make('recurrence')->previewOccurrencesLimit(10);
When the start date is empty (with
nullable() in effect), “Repeat every” stays disabled until a start date is set.Table column
use Andreia\FilamentRecurrence\Tables\Columns\RecurrenceColumn;
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('title'),
RecurrenceColumn::make('recurrence')
->showNextOccurrences(limit: 3)
->showRule(),
]);
}
| Method | Effect |
|---|---|
->showRule(bool $show = true) | Display the RRULE string |
->showNextOccurrences(bool $show = true, int $limit = 5) | Show the next N occurrences |
Infolist entry
use Andreia\FilamentRecurrence\Infolists\Components\RecurrenceEntry;
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('title'),
RecurrenceEntry::make('recurrence')
->showAllDetails()
->showNextOccurrences(limit: 10)
->showRule(),
]);
}
| Method | Effect |
|---|---|
->showRule(bool $show = true) | Display the RRULE string |
->showAllDetails(bool $show = true) | Show all recurrence details |
->showNextOccurrences(bool $show = true, int $limit = 20) | Show the next N occurrences |
RecurrenceData DTO and example rules for every frequency.
