PHPackages                             schedulemycoach/laravel7-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. schedulemycoach/laravel7-fullcalendar

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

schedulemycoach/laravel7-fullcalendar
=====================================

Updated Laravel component for fullcalendar package base on Edo Freriks original package

1.08(3y ago)166MITPHPPHP ^7.3|^8.0|^8.1

Since Jul 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/schedulemycoach/laravel7-fullcalendar)[ Packagist](https://packagist.org/packages/schedulemycoach/laravel7-fullcalendar)[ Docs](https://github.com/schedulemycoach/laravel7-fullcalendar)[ RSS](/packages/schedulemycoach-laravel7-fullcalendar/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (11)Used By (0)

Laravel 7/8/9 Fullcalendar component
====================================

[](#laravel-789-fullcalendar-component)

Notice: This is a fork of Edofre/laravel-fullcalendar package, which I have grown to love and use. This package is now code compliant for the newer versions of Laravel 7 and FullCalendar v5. This version will now install adding the required NPM packages directly without Bower or the fxp/composer-asset plugin.

Warning
-------

[](#warning)

If you are upgrading from a previous version I would remove Edofre/laravel-fullcalendar package, any unneeded Bower/fxp/composer-asset plugin components if composer fails to remove them, the original Edo service provider and alias in the config/app file and any FullCalendar config and FullCalendar CSS/JS files from that previous package in your public folder. You may need to remove the old Edo package lines from the bootstrap/config.php file if you get this error:

```
Class 'Edofre\Fullcalendar\FullcalendarServiceProvider' not found

```

I also had to remove the FullCalendar, Moment and jQuery from the NPM.

```
npm remove fullcalendar

```

Use with Laravel/Homestead
--------------------------

[](#use-with-laravelhomestead)

This package will NOT install properly under Laravel/Homestead on Windows because of VirtualBox issues **without** following these steps. Right click your command window (Typically GIT Bash) and choose run as Administrator. In your Homestead Yaml file the folders section should look something like this:

```
folders:
    - map: your_programming_directory
      to: /home/vagrant/code
      type: "smb"

```

This will require you to enter your Windows User name and password. More information here: [https://www.vagrantup.com/docs/synced-folders/smb.html#smb\_username](https://www.vagrantup.com/docs/synced-folders/smb.html#smb_username). The first time I made this change I provisioned when I brought Vagrant up.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

To install, either run

```
$ php composer.phar require schedulemycoach/laravel7-fullcalendar

```

or add

```
"schedulemycoach/laravel7-fullcalendar": "^1.0.5"

```

to the `require` section of your `composer.json` file.

### Note

[](#note)

The fxp/composer-asset plugin is no longer required for this package to install properly. We have converted this package to use Foxy. This plugin enables you to download NPM packages through composer and is included as part of this package. You can find more info on this page: .

Configuration
-------------

[](#configuration)

Add the ServiceProvider to your config/app.php

```
'providers' => [
        ...
        schedulemycoach\Fullcalendar\FullcalendarServiceProvider::class,
    ],
```

And add the facade

```
'aliases' => [
        ...
        'Fullcalendar' => schedulemycoach\Fullcalendar\Facades\Fullcalendar::class,
    ],
```

Publish assets and configuration files

```
php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=fullcalendar

```

### The Config File

[](#the-config-file)

By publish the vendor config file you will find a new file called fullcalendar.php in the /config folder. These configs allow you to load either the minified or non-minified CSS and JS for Fullcalander.

#### Google Calendar Inclusion

[](#google-calendar-inclusion)

Per the Fullcalendar NPM package the google calendar CSS/JS files are now included and do not need to be loaded seperately.

### Manually loading script files

[](#manually-loading-script-files)

By setting the both the include\_scripts options in the config file to *false* the scripts will not be included when generating the calendar. If you want to manually include the scripts you can call the following static function in your header/footer/etc.

#### For the Full files

[](#for-the-full-files)

```
    \schedulemycoach\Fullcalendar\Fullcalendar::renderFullScriptFiles();

```

#### For the Minified files

[](#for-the-minified-files)

```
      \schedulemycoach\Fullcalendar\Fullcalendar::renderMinScriptFiles();

```

### Example

[](#example)

Below is an example of a controller action configuring the calendar

```
    public function index()
    {
        // Generate a new fullcalendar instance
        $calendar = new \schedulemycoach\Fullcalendar\Fullcalendar();

        // You can manually add the objects as an array
        $events = $this->getEvents();
        $calendar->setEvents($events);
        // Or you can add a route and return the events using an ajax requests that returns the events as json
        $calendar->setEvents(route('fullcalendar-ajax-events'));

        // Set options
        $calendar->setOptions([
            'locale'      => 'en',
            'weekNumbers' => true,
            'selectable'  => true,
            'themeSystem' =>'bootstrap',
            /* Scripts need for this are not included in the package. See bootstrap theming at https://fullcalendar.io/docs/bootstrap-theme */
            'initialView' => 'dayGridMonth',
         /* options are dayGridMonth,dayGridWeek,dayGridDay,dayGrid,timeGridWeek,timeGridDay,timeGrid,listYear,listMonth,listWeek,listDay,list */
            // Add the callbacks
            'eventClick' => new \schedulemycoach\Fullcalendar\JsExpression("
                function(data, jsEvent, view) {
                    console.log(data.event);
