PHPackages                             guillermobt/laravel-fullcalendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. guillermobt/laravel-fullcalendar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

guillermobt/laravel-fullcalendar
================================

Laravel helper for FullCalendar.io. This fork (guillermobt) fixes schedule time in agenda views

v1.2.4(10y ago)2693↓66.7%2MITPHPPHP &gt;=5.4.0

Since Feb 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/guillermobt/laravel-fullcalendar)[ Packagist](https://packagist.org/packages/guillermobt/laravel-fullcalendar)[ RSS](/packages/guillermobt-laravel-fullcalendar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (18)Used By (0)

About this fork
===============

[](#about-this-fork)

This fork fixes an issue with the Agenda views in which all the events were showing up scheduled at 00:00 hours. Credits for this plugin belong to MaddHatter (). I decided to fork after timing-out my pull-request to maddhatter :)

Laravel 5 Full Calendar Helper
==============================

[](#laravel-5-full-calendar-helper)

[![Latest Stable Version](https://camo.githubusercontent.com/c3acd187e9de97c3908a9505fb420ee9e086e9a10091bd899cabaf96ff280d23/68747470733a2f2f706f7365722e707567782e6f72672f6775696c6c65726d6f62742f6c61726176656c2d66756c6c63616c656e6461722f762f737461626c65)](https://packagist.org/packages/guillermobt/laravel-fullcalendar) [![Total Downloads](https://camo.githubusercontent.com/44e75bc339a4bcdd9e4b179c2b7da74034f27f9ba9a36787747bdfc1e158f774/68747470733a2f2f706f7365722e707567782e6f72672f6775696c6c65726d6f62742f6c61726176656c2d66756c6c63616c656e6461722f646f776e6c6f616473)](https://packagist.org/packages/guillermobt/laravel-fullcalendar) [![Latest Unstable Version](https://camo.githubusercontent.com/a61937790a97b2a3194c898f019a1e91e8d97bcc1bd63d95db4d0511425c5842/68747470733a2f2f706f7365722e707567782e6f72672f6775696c6c65726d6f62742f6c61726176656c2d66756c6c63616c656e6461722f762f756e737461626c65)](https://packagist.org/packages/guillermobt/laravel-fullcalendar) [![License](https://camo.githubusercontent.com/f13b716e8482ee262396d945df71db319d9ebb7561379db555b28996361e2c3d/68747470733a2f2f706f7365722e707567782e6f72672f6775696c6c65726d6f62742f6c61726176656c2d66756c6c63616c656e6461722f6c6963656e7365)](https://packagist.org/packages/guillermobt/laravel-fullcalendar)

***For Laravel 4.2: use the [laravel-4 branch](https://github.com/maddhatter/laravel-fullcalendar/tree/laravel-4)***

This is a simple helper package to make generating  in Laravel apps easier.

Installing
----------

[](#installing)

Require the package with composer using the following command:

```
composer require guillermobt/laravel-fullcalendar

```

Or add the following to your composer.json's require section and `composer update`

```
"require": {
	"guillermobt/laravel-fullcalendar": "dev-master"
}
```

Then register the service provider in your `app.php` config file:

```
guillermobt\LaravelFullcalendar\ServiceProvider::class,
```

And optionally create an alias:

```
'Calendar' => guillermobt\LaravelFullcalendar\Facades\Calendar::class,
```

You will also need to include [fullcalendar.io](http://fullcalendar.io/)'s files in your HTML.

Usage
-----

[](#usage)

### Creating Events

[](#creating-events)

#### Using `event()`:

[](#using-event)

The simpliest way to create an event is to pass the event information to `Calendar::event()`:

```
$event = \Calendar::event(
    "Valentine's Day", //event title
    true, //full day event?
    '2015-02-14', //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)
    '2015-02-14', //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),
	1, //optional event ID
	[
		'url' => 'http://full-calendar.io'
	]
);
```

#### Implementing `Event` Interface

[](#implementing-event-interface)

Alternatively, you can use an existing class and have it implement `guillermobt\LaravelFullcalendar\Event`. An example of an Eloquent model that implements the `Event` interface:

```
class EventModel extends Eloquent implements \guillermobt\LaravelFullcalendar\Event
{

    protected $dates = ['start', 'end'];

    /**
     * Get the event's id number
     *
     * @return int
     */
    public function getId() {
		return $this->id;
	}

    /**
     * Get the event's title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Is it an all day event?
     *
     * @return bool
     */
    public function isAllDay()
    {
        return (bool)$this->all_day;
    }

    /**
     * Get the start time
     *
     * @return DateTime
     */
    public function getStart()
    {
        return $this->start;
    }

    /**
     * Get the end time
     *
     * @return DateTime
     */
    public function getEnd()
    {
        return $this->end;
    }
}
```

#### `IdentifiableEvent` Interface

[](#identifiableevent-interface)

If you wish for your existing class to have event IDs, implement `\guillermobt\LaravelFullcalendar\IdentifiableEvent` instead. This interface extends `\guillermobt\LaravelFullcalendar\Event` to add a `getId()` method:

```
class EventModel extends Eloquent implements \guillermobt\LaravelFullcalendar\IdentifiableEvent
{

	// Implement all Event methods ...

    /**
     * Get the event's ID
     *
     * @return int|string|null
     */
    public function getId();

}
```

### Additional Event Parameters

[](#additional-event-parameters)

If you want to add [additional parameters](http://fullcalendar.io/docs/event_data/Event_Object) to your events, there are two options:

#### Using `Calendar::event()`

[](#using-calendarevent)

Pass an array of `'parameter' => 'value'` pairs as the 6th parameter to `Calendar::event()`:

```
$event = \Calendar::event(
    "Valentine's Day", //event title
    true, //full day event?
    '2015-02-14', //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)
    '2015-02-14', //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),
	1, //optional event ID
	[
		'url' => 'http://full-calendar.io',
		//any other full-calendar supported parameters
	]
);
```

#### Add an `getEventOptions` method to your event class

[](#add-an-geteventoptions-method-to-your-event-class)

```
