warete/moonshine-fullcalendar-resource

FullCalendarJS integration for MoonShine admin panel

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/warete/moonshine-fullcalendar-resource

1.0.0 2026-02-27 12:00 UTC

This package is auto-updated.

Last update: 2026-02-27 12:04:05 UTC


README

Calendar month view

Total Downloads Latest Stable Version License

FullCalendar-powered MoonShine resource pages with async loading, modal CRUD flows, and resource-scoped refresh.

warete/moonshine-fullcalendar-resource adds a reusable calendar index page for MoonShine v4 resources. It keeps the standard MoonShine CRUD flow, loads events asynchronously, supports event-specific action dropdowns, and refreshes the active calendar after create, update, delete, and date mutations. Extra extendedProps are opt-in, so only explicitly exposed values reach the browser.

Languages: English | Русский

Compatibility

MoonShine FullCalendar Resource Currently supported
4.x 1.x yes

Installation

composer require warete/moonshine-fullcalendar-resource
php artisan vendor:publish --tag=moonshine-fullcalendar-assets

The package already ships compiled assets in public/, so for package consumers publishing vendor assets is enough. npm install and npm run build are only needed when developing this package itself.

Key Features

  • Async event loading for the visible FullCalendar range
  • MoonShine modal create/edit/delete flows with automatic calendar refresh
  • Resource-level hooks for event formatting and per-event actions
  • Support for custom ActionButton items per calendar event
  • Configurable views, toolbar, locale, timezone, and grid-create behavior

Calendar week view Calendar day view Calendar list view

Calendar event detail Calendar event edit

Example

<?php

declare(strict_types=1);

namespace App\MoonShine\Resources;

use App\Models\CalendarEvent;
use MoonShine\Crud\Contracts\Page\DetailPageContract;
use MoonShine\Crud\Contracts\Page\FormPageContract;
use MoonShine\UI\Fields\Color;
use MoonShine\UI\Fields\Date;
use MoonShine\UI\Fields\ID;
use MoonShine\UI\Fields\Text;
use MoonShine\UI\Fields\Textarea;
use Warete\MoonShineFullCalendar\Pages\FullCalendarIndexPage;
use Warete\MoonShineFullCalendar\Resources\FullCalendarResource;

final class CalendarEventsResource extends FullCalendarResource
{
    protected string $model = CalendarEvent::class;

    protected string $title = 'Calendar Events';

    protected string $startColumn = 'start';

    protected string $endColumn = 'end';

    protected function pages(): array
    {
        return [
            FullCalendarIndexPage::class,
            FormPageContract::class,
            DetailPageContract::class,
        ];
    }

    protected function formFields(): array
    {
        return [
            ID::make()->sortable(),
            Text::make('Title', 'title')->required(),
            Date::make('Start', $this->startColumn)->withTime()->required(),
            Date::make('End', $this->endColumn)->withTime()->required(),
            Color::make('Color', 'color')->nullable(),
            Textarea::make('Description', 'description')->nullable(),
        ];
    }
}

Event Actions

Every calendar event can expose backend-rendered MoonShine actions in the event dropdown. To append your own actions, override getCustomCalendarEventActions(Model $item): iterable and return ActionButton instances or raw HTML strings.

use Illuminate\Database\Eloquent\Model;
use MoonShine\UI\Components\ActionButton;

protected function getCustomCalendarEventActions(Model $item): iterable
{
    return [
        ActionButton::make('Duplicate', route('events.duplicate', $item))
            ->primary()
            ->async(),
    ];
}

Event Payload

By default, the package only ships the standard FullCalendar fields plus extendedProps.moonshineFullCalendar.actions. To expose extra browser-visible metadata, override getCalendarEventExtendedProps(Model $item): array and return an explicit allowlist.

protected function getCalendarEventExtendedProps(Model $item): array
{
    return [
        'description' => $item->description,
        'location' => $item->location,
    ];
}

Documentation

Support

License

MIT