Download the PHP package defmost/laravel-full-calendar without Composer
On this page you can find all versions of the php package defmost/laravel-full-calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download defmost/laravel-full-calendar
More information about defmost/laravel-full-calendar
Files in defmost/laravel-full-calendar
Package laravel-full-calendar
Short Description Laravel helper for FullCalendar.io. Fork of https://github.com/maddhatter/laravel-fullcalendar
License MIT
Homepage https://github.com/defmost/laravel-full-calendar
Informations about the package laravel-full-calendar
Laravel 9 Full Calendar Helper
This is a fork of https://github.com/nelkasovic/laravel-full-calendar. A simple helper package to make generating http://fullcalendar.io in Laravel apps easier. Because the package is abandoned I decided to fork and publish a version which should work with Laravel 6.
Installing
Require the package with composer using the following command:
composer require defmost/laravel-full-calendar
Or add the following to your composer.json's require section and composer update
Laravel 8+
The provider and Calendar
alias will be registered automatically.
You will also need to include fullcalendar.io's files in your HTML.
Usage
Creating Events
Using event()
:
The simpliest way to create an event is to pass the event information to Calendar::event()
:
Implementing Event
Interface
Alternatively, you can use an existing class and have it implement LaravelFullCalendar\Event
. An example of an Eloquent model that implements the Event
interface:
IdentifiableEvent
Interface
If you wish for your existing class to have event IDs, implement \LaravelFullcalendar\IdentifiableEvent
instead. This interface extends \LaravelFullcalendar\Event
to add a getId()
method:
Additional Event Parameters
If you want to add additional parameters to your events, there are two options:
Using Calendar::event()
Pass an array of 'parameter' => 'value'
pairs as the 6th parameter to Calendar::event()
:
Add an getEventOptions
method to your event class
Create a Calendar
To create a calendar, in your route or controller, create your event(s), then pass them to Calendar::addEvent()
or Calendar::addEvents()
(to add an array of events). addEvent()
and addEvents()
can be used fluently (chained together). Their second parameter accepts an array of valid FullCalendar Event Object parameters.
Sample Controller code:
Sample View
Then to display, add the following code to your View:
Note: The output from calendar()
and script()
must be non-escaped, so use {!!
and !!}
(or whatever you've configured your Blade compiler's raw tag directives as).
The script()
can be placed anywhere after calendar()
, and must be after fullcalendar was included.
This will generate (in February 2020):
All versions of laravel-full-calendar with dependencies
illuminate/database Version ^8.0|^9.0
illuminate/support Version ^8.0|^9.0
laravel/helpers Version ^1.0