{"id":33983655,"url":"https://github.com/smirltech/laravel-fullcalendar","last_synced_at":"2025-12-30T06:22:18.843Z","repository":{"id":65137794,"uuid":"582946315","full_name":"smirltech/laravel-fullcalendar","owner":"smirltech","description":"Laravel 9 FullCalendar.io Helper","archived":false,"fork":true,"pushed_at":"2023-03-20T15:31:06.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T19:56:45.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/smirltech/laravel-fullcalendar","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"maddhatter/laravel-fullcalendar","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smirltech.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-28T10:07:33.000Z","updated_at":"2023-03-04T06:52:43.000Z","dependencies_parsed_at":"2023-02-02T13:45:58.616Z","dependency_job_id":null,"html_url":"https://github.com/smirltech/laravel-fullcalendar","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/smirltech/laravel-fullcalendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirltech%2Flaravel-fullcalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirltech%2Flaravel-fullcalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirltech%2Flaravel-fullcalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirltech%2Flaravel-fullcalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smirltech","download_url":"https://codeload.github.com/smirltech/laravel-fullcalendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smirltech%2Flaravel-fullcalendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27699693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-13T04:08:16.807Z","updated_at":"2025-12-13T04:08:17.847Z","avatar_url":"https://github.com/smirltech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel 9 Full Calendar Helper\r\n\r\n[![Latest Stable Version](https://poser.pugx.org/smirltech/laravel-fullcalendar/v/stable)](https://packagist.org/packages/smirltech/laravel-fullcalendar) [![Total Downloads](https://poser.pugx.org/smirltech/laravel-fullcalendar/downloads)](https://packagist.org/packages/smirltech/laravel-fullcalendar) [![Latest Unstable Version](https://poser.pugx.org/smirltech/laravel-fullcalendar/v/unstable)](https://packagist.org/packages/smirltech/laravel-fullcalendar) [![License](https://poser.pugx.org/smirltech/laravel-fullcalendar/license)](https://packagist.org/packages/smirltech/laravel-fullcalendar)\r\n\r\nThis is a simple helper package to make generating [http://fullcalendar.io](http://fullcalendar.io) in Laravel apps easier.\r\n\r\n## Installing\r\nRequire the package with composer using the following command:\r\n\r\n    composer require smirltech/laravel-fullcalendar\r\n\r\nOr add the following to your composer.json's require section and `composer update`\r\n\r\n```json\r\n\"require\": {\r\n\t\"smirltech/laravel-fullcalendar\": \"~1.0.2\"\r\n}\r\n```\r\nThe provider and `Calendar` alias will be registered automatically.\r\n\r\nYou won't need to include [fullcalendar.io](http://fullcalendar.io/)'s files in your HTML, version 6.0.2 is included in this package.\r\n\r\n\r\n\r\n## Usage\r\n\r\n### Creating Events\r\n\r\n#### Using `event()`:\r\nThe simpliest way to create an event is to pass the event information to `Calendar::event()`:\r\n\r\n\r\n```php\r\n$event = \\Calendar::event(\r\n    \"Valentine's Day\", //event title\r\n    true, //full day event?\r\n    '2015-02-14', //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\r\n    '2015-02-14', //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\r\n\t1, //optional event ID\r\n\t[\r\n\t\t'url' =\u003e 'http://full-calendar.io'\r\n\t]\r\n);\r\n```\r\n#### Implementing `Event` Interface\r\n\r\nAlternatively, you can use an existing class and have it implement `SmirlTech\\LaravelFullcalendar\\Event`. An example of an Eloquent model that implements the `Event` interface:\r\n\r\n```php\r\nclass EventModel extends Eloquent implements \\SmirlTech\\LaravelFullcalendar\\Event\r\n{\r\n\r\n    protected $dates = ['start', 'end'];\r\n\r\n    /**\r\n     * Get the event's id number\r\n     *\r\n     * @return int\r\n     */\r\n    public function getId() {\r\n\t\treturn $this-\u003eid;\r\n\t}\r\n\r\n    /**\r\n     * Get the event's title\r\n     *\r\n     * @return string\r\n     */\r\n    public function getTitle()\r\n    {\r\n        return $this-\u003etitle;\r\n    }\r\n\r\n    /**\r\n     * Is it an all day event?\r\n     *\r\n     * @return bool\r\n     */\r\n    public function isAllDay()\r\n    {\r\n        return (bool)$this-\u003eall_day;\r\n    }\r\n\r\n    /**\r\n     * Get the start time\r\n     *\r\n     * @return DateTime\r\n     */\r\n    public function getStart()\r\n    {\r\n        return $this-\u003estart;\r\n    }\r\n\r\n    /**\r\n     * Get the end time\r\n     *\r\n     * @return DateTime\r\n     */\r\n    public function getEnd()\r\n    {\r\n        return $this-\u003eend;\r\n    }\r\n}\r\n```\r\n\r\n#### `IdentifiableEvent` Interface\r\n\r\nIf you wish for your existing class to have event IDs, implement `\\SmirlTech\\LaravelFullcalendar\\IdentifiableEvent` instead. This interface extends `\\SmirlTech\\LaravelFullcalendar\\Event` to add a `getId()` method:\r\n\r\n```php\r\nclass EventModel extends Eloquent implements \\SmirlTech\\LaravelFullcalendar\\IdentifiableEvent\r\n{\r\n\r\n\t// Implement all Event methods ...\r\n\r\n    /**\r\n     * Get the event's ID\r\n     *\r\n     * @return int|string|null\r\n     */\r\n    public function getId();\r\n\r\n}\r\n\r\n```\r\n\r\n### Additional Event Parameters\r\n\r\nIf you want to add [additional parameters](http://fullcalendar.io/docs/event_data/Event_Object) to your events, there are two options:\r\n\r\n#### Using `Calendar::event()`\r\n\r\nPass an array of `'parameter' =\u003e 'value'` pairs as the 6th parameter to `Calendar::event()`:\r\n\r\n```php\r\n$event = \\Calendar::event(\r\n    \"Valentine's Day\", //event title\r\n    true, //full day event?\r\n    '2015-02-14', //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\r\n    '2015-02-14', //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\r\n\t1, //optional event ID\r\n\t[\r\n\t\t'url' =\u003e 'http://full-calendar.io',\r\n\t\t//any other full-calendar supported parameters\r\n\t]\r\n);\r\n\r\n```\r\n\r\n#### Add an `getEventOptions` method to your event class\r\n\r\n```php\r\n\u003c?php\r\nclass CalendarEvent extends \\Illuminate\\Database\\Eloquent\\Model implements \\SmirlTech\\LaravelFullcalendar\\Event\r\n{\r\n\t//...\r\n\r\n\t/**\r\n     * Optional FullCalendar.io settings for this event\r\n     *\r\n     * @return array\r\n     */\r\n    public function getEventOptions()\r\n    {\r\n        return [\r\n            'color' =\u003e $this-\u003ebackground_color,\r\n\t\t\t//etc\r\n        ];\r\n    }\r\n\r\n\t//...\r\n}\r\n\r\n```\r\n\r\n### Create a Calendar\r\nTo 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](http://fullcalendar.io/docs/event_data/Event_Object/).\r\n\r\n#### Sample Controller code:\r\n\r\n```php\r\n$events = [];\r\n\r\n$events[] = \\Calendar::event(\r\n    'Event One', //event title\r\n    false, //full day event?\r\n    '2015-02-11T0800', //start time (you can also use Carbon instead of DateTime)\r\n    '2015-02-12T0800', //end time (you can also use Carbon instead of DateTime)\r\n\t0 //optionally, you can specify an event ID\r\n);\r\n\r\n$events[] = \\Calendar::event(\r\n    \"Valentine's Day\", //event title\r\n    true, //full day event?\r\n    new \\DateTime('2015-02-14'), //start time (you can also use Carbon instead of DateTime)\r\n    new \\DateTime('2015-02-14'), //end time (you can also use Carbon instead of DateTime)\r\n\t'stringEventId' //optionally, you can specify an event ID\r\n);\r\n\r\n$eloquentEvent = EventModel::first(); //EventModel implements SmirlTech\\LaravelFullcalendar\\Event\r\n\r\n$calendar = \\Calendar::addEvents($events) //add an array with addEvents\r\n    -\u003eaddEvent($eloquentEvent, [ //set custom color fo this event\r\n        'color' =\u003e '#800',\r\n    ])-\u003esetOptions([ //set fullcalendar options\r\n\t\t'firstDay' =\u003e 1\r\n\t])-\u003esetCallbacks([ //set fullcalendar callback options (will not be JSON encoded)\r\n        'viewRender' =\u003e 'function() {alert(\"Callbacks!\");}'\r\n    ]);\r\n\r\nreturn view('hello', compact('calendar'));\r\n```\r\n\r\n\r\n#### Sample View\r\n\r\nThen to display, add the following code to your View:\r\n\r\n```html\r\n\u003c!doctype html\u003e\r\n\u003chtml lang=\"en\"\u003e\r\n\u003cbody\u003e\r\n    {!! $calendar-\u003ecalendar() !!}\r\n    {!! $calendar-\u003escript() !!}\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n```\r\n**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).   \r\n\r\nThe `script()` can be placed anywhere after `calendar()`, and must be after fullcalendar was included.\r\n\r\nThis will generate (in February 2022):\r\n\r\n![](img.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmirltech%2Flaravel-fullcalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmirltech%2Flaravel-fullcalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmirltech%2Flaravel-fullcalendar/lists"}