PHPackages                             ecasanes/laravel-google-calendar-php-6 - 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. ecasanes/laravel-google-calendar-php-6

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

ecasanes/laravel-google-calendar-php-6
======================================

Manage events on a Google Calendar (Compatible with PHP 5.6.15 up)

1.1.0(9y ago)01081MITPHPPHP ^7.0

Since May 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ecasanes/laravel-google-calendar)[ Packagist](https://packagist.org/packages/ecasanes/laravel-google-calendar-php-6)[ Docs](https://github.com/spatie/laravel-google-calendar)[ RSS](/packages/ecasanes-laravel-google-calendar-php-6/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

Manage events on a Google Calendar
==================================

[](#manage-events-on-a-google-calendar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a47c398db0c12dac2e6fb2f815f56b171d6ded7dc55942b666424eacd70c7b11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d676f6f676c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-google-calendar)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/00b8db7d3a71dddb264b7b6fbe35eb6c8874eba00c32bc473fa49b3c2e2e4c95/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f6c61726176656c2d676f6f676c652d63616c656e6461722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/laravel-google-calendar)[![SensioLabsInsight](https://camo.githubusercontent.com/be6c8f8e643cf1bdeedba2e797c5ea12bd3c706e7a9cbbb89b2e16d4024f7f14/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f61393636343132622d303931622d343430372d623530392d3666373437323933356230652e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/a966412b-091b-4407-b509-6f7472935b0e)[![Quality Score](https://camo.githubusercontent.com/2408e829d44906a6f0ca14264d98ad33e18f81ab611ad652722818d868274f5a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f6c61726176656c2d676f6f676c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/laravel-google-calendar)[![StyleCI](https://camo.githubusercontent.com/85567fa7e5d71d235604716e48e907fdd4dc4a1ad1bbe0663ca1baa37cbe9aee/68747470733a2f2f7374796c6563692e696f2f7265706f732f35383330353930332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/58305903)[![Total Downloads](https://camo.githubusercontent.com/1172d5d02f2126c5738a92beeb8d7d5b739ba16a05fcb67924f544742ae38d75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d676f6f676c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-google-calendar)

This package makes working with a Google Calendar a breeze. Once it has been set up you can do these things:

```
use Spatie\GoogleCalendar\Event;

//create a new event
$event = new Event;

$event->name = 'A new event';
$event->startDateTime = Carbon\Carbon::now();
$event->endDateTime = Carbon\Carbon::now()->addHour();
$event->addAttendee(['email' => 'youremail@gmail.com']);
$event->addAttendee(['email' => 'anotherEmail@gmail.com']);

$event->save();

// get all future events on a calendar
$events = Event::get();

$firstEvent = $events->first();
$firstEvent->name = 'updated name';
$firstEvent->save();

// create a new event
Event::create([
   'name' => 'A new event'
   'startDateTime' => Carbon\Carbon::now(),
   'endDateTime' => Carbon\Carbon::now()->addHour(),
]);

// delete an event
$event->delete();
```

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Postcardware
------------

[](#postcardware)

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

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

[](#installation)

You can install the package via composer:

```
composer require ecasanes/laravel-google-calendar-php-6
```

Next up the service provider must be registered:

```
'providers' => [
    ...
    Spatie\GoogleCalendar\GoogleCalendarServiceProvider::class,
];
```

Optionally the `Spatie\GoogleCalendar\GoogleCalendarFacade` must be registered:

```
'aliases' => [
	...
    'GoogleCalendar' => Spatie\GoogleCalendar\GoogleCalendarFacade::class,
    ...
]
```

You must publish the configuration with this command:

```
php artisan vendor:publish --provider="Spatie\GoogleCalendar\GoogleCalendarServiceProvider"
```

This will publish file called `laravel-google-calendar.php` in your config-directory with this contents:

```
