ko/laravel-fullcalendar

Laravel helper for FullCalendar.io

0.0.9 2019-01-03 18:56 UTC

This package is not auto-updated.

Last update: 2024-05-03 21:31:39 UTC


README

68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667

Build Status Total Downloads Latest Stable Version License

ko-laravel-fullcalendar

This package is a composer installable helper for working with fullcalendar.io in a laravel app.

Usage

Building an Event

$event = new \KO\Fullcalendar\Event();
$event->build(['id'=>'asdf', 'title' => 'test', 'start' => '20-04-2018']);

Adding an Event to an EventCollection

$events = new \KO\Fullcalendar\EventCollection();
$events->push( $event );

Custom options

$options = new \KO\Fullcalendar\Options([
    'header' => [
        'right' => 'prev,next today',
        'center' => 'title',
        'left' => 'month,agendaWeek,agendaDay',
    ],
    'eventLimit' => true,
]);

Instantiate a new Calendar

$calendar = new \KO\Fullcalendar\Calendar();
$calendar->addEvents( $events );
$calendar->setOptions( $options );

Draw the calendar

In your blade, add the following where you would like the calendar to be drawn.

  {!! $calendar->html() !!}

CDN

This package has a helper method for building the appropriate style and javascript assets from a CDN. Just add the following to your html to load the appropriate resources.

Fullcalendar css

{!! $calendar->cdn('fullcalendar', 'css', '3.9.0') !!}

Fullcalendar js

{!! $calendar->cdn('fullcalendar', 'js', '3.9.0') !!}

Moment js

{!! $calendar->cdn('moment', 'js', '2.22.1') !!}