diff --git a/README.md b/README.md index d7af672..fedfb1e 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,31 @@ class AdminPanelProvider extends PanelProvider } ``` +```php + 1, + 'headerToolbar' => [ + 'left' => 'dayGridWeek,dayGridDay', + 'center' => 'title', + 'right' => 'prev,next today', + ], + ]; + } +} +``` + ## Available methods ### schedulerLicenseKey(`string` | `null` $licenseKey) diff --git a/composer.json b/composer.json index 98c70c4..87143f1 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,9 @@ "spatie/laravel-ray": "^1.26" }, "autoload": { + "files": [ + "src/helpers.php" + ], "psr-4": { "Saade\\FilamentFullCalendar\\": "src" } diff --git a/resources/views/fullcalendar.blade.php b/resources/views/fullcalendar.blade.php index 0a3c9e3..fbff8c5 100644 --- a/resources/views/fullcalendar.blade.php +++ b/resources/views/fullcalendar.blade.php @@ -16,7 +16,7 @@ plugins: @js($plugin->getPlugins()), schedulerLicenseKey: @js($plugin->getSchedulerLicenseKey()), timeZone: @js($plugin->getTimezone()), - config: @js($plugin->getConfig()), + config: @js($this->getConfig()), editable: @json($plugin->isEditable()), selectable: @json($plugin->isSelectable()), })"> diff --git a/src/Widgets/Concerns/CanBeConfigured.php b/src/Widgets/Concerns/CanBeConfigured.php new file mode 100644 index 0000000..6e5a0ef --- /dev/null +++ b/src/Widgets/Concerns/CanBeConfigured.php @@ -0,0 +1,23 @@ +getConfig(), + $this->config(), + ); + } +} diff --git a/src/Widgets/FullCalendarWidget.php b/src/Widgets/FullCalendarWidget.php index e83fa08..cbbdad7 100644 --- a/src/Widgets/FullCalendarWidget.php +++ b/src/Widgets/FullCalendarWidget.php @@ -18,6 +18,7 @@ class FullCalendarWidget extends Widget implements HasForms, HasActions use Concerns\InteractsWithRecords; use Concerns\InteractsWithHeaderActions; use Concerns\InteractsWithModalActions; + use Concerns\CanBeConfigured; protected static string $view = 'filament-fullcalendar::fullcalendar'; diff --git a/src/helpers.php b/src/helpers.php new file mode 100644 index 0000000..8735ea3 --- /dev/null +++ b/src/helpers.php @@ -0,0 +1,18 @@ + $value) { + if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) { + $array1[$key] = array_merge_recursive_unique($array1[$key], $value); + } else { + $array1[$key] = $value; + } + } + + return $array1; + } +}