PHPackages                             zaupita/laravel-google-calendar - 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. [API Development](/categories/api)
4. /
5. zaupita/laravel-google-calendar

ActiveLibrary[API Development](/categories/api)

zaupita/laravel-google-calendar
===============================

Laravel wrapper for Google Calendar API that utilizes the Google Client API.

v1.7(4y ago)0311MITPHPPHP &gt;=7.0

Since Jun 15Pushed 4y agoCompare

[ Source](https://github.com/zaupita/laravel-google-calendar)[ Packagist](https://packagist.org/packages/zaupita/laravel-google-calendar)[ RSS](/packages/zaupita-laravel-google-calendar/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

laravel-google-calendar
=======================

[](#laravel-google-calendar)

Laravel wrapper for Google Calendar API that (unlike other solutions) utilizes the Google Client API rather than Google Service Accounts. Works seamlessly with [FullCalendar.io](http://fullcalendar.io).

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Available Methods](#available-methods)
    - [Expose API](#expose-api)
    - [FullCalendar.io Integration](#fullcalendario-integration)

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

[](#installation)

This package can be used in Laravel 5.4 or higher.

You can install the package via composer:

```
composer require zaupita/laravel-google-calendar
```

In Laravel 5.5+ the service provider and alias will automatically get registered and you can skip this step. In older versions of the framework just add the service provider and alias in `config/app.php` file:

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

// ...

'aliases' => [
    // ...
    'GoogleCalendar' => zaupita\GoogleCalendar\Facades\GoogleCalendar::class,
];
```

You can now publish [the migration](https://github.com/zaupita/laravel-google-calendar/blob/master/database/migrations/update_users_table.php) and [config](https://github.com/zaupita/laravel-google-calendar/blob/master/config/google_calendar.php) files and migrate updates to the user table with:

```
php artisan vendor:publish --provider="zaupita\GoogleCalendar\GoogleCalendarServiceProvider" && php artisan migrate
```

Note: If you are using a database that does not use the JSON field-type (e.g. older versions of MariaDB), you may get a database error while trying to run your migration. In that case, you will need to change the 'google\_access\_token' column to 'LONGTEXT' in the '[update\_users\_table.php](https://github.com/zaupita/laravel-google-calendar/blob/master/database/migrations/update_users_table.php)' migration file (published by the above command). Then, re-run your migration using `php artisan migrate`.

**Success!** laravel-google-calendar is now installed!

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

[](#configuration)

The first step to properly configure laravel-google-calendar, you need Google API credentials. You can obtain these credentials at .

Copy and paste the Google API credentials into your `.env` file. For example:

```
GOOGLE_CLIENT_ID=C13n71D_7166xlnk4q4fd24hdeteq.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=s3cr37sMnYiOk4i8fr2rX
```

Usage
-----

[](#usage)

GoogleCalendar can be accessed using the easy-to-remember Facade, "GoogleCalendar."

### Available Methods

[](#available-methods)

#### getAuthUrl()

[](#getauthurl)

Gets the interstitial Google Client API authentication URL.

> *Optional* `$redirect`: Pass a relative URL (e.g. '/dashboard') to redirect user after authenticated with Google. Defaults to site root (i.e. '/').

#### isAuthed()

[](#isauthed)

Checks if currently logged in user is authenticated with Google Client API.

#### listCalendars()

[](#listcalendars)

Lists the available calendars for the currently logged in user.

> *Optional* `$accessToken`: Helpful when you need to manually set a user's access token (e.g. using API authentication rather than Web). Defaults to 'google\_access\_token' column in the `users` table.

#### listEvents()

[](#listevents)

Lists the events for the currently logged in user.

> *Optional* `$calendarId`: Manually set Calendar ID. Defaults to 'primary' calendar.
>
> *Optional* `$accessToken`: Helpful when you need to manually set a user's access token (e.g. using API authentication rather than Web). Defaults to 'google\_access\_token' column in the `users` table.
>
> *Optional* `$start`: Defaults to beginning of current month.
>
> *Optional* `$end`: Defaults to end of current month.
>
> *Optional* `$timezone`: Defaults to null.

#### updateEvent($request)

[](#updateeventrequest)

> **Required** `$request`: The request object should contain a value for 'calendarId', 'eventId', 'summary', 'location', 'description', 'allDay', 'start', and 'end'. The 'timezone' and 'attendees' are optional. 'Timezone' should be formatted according to the corresponding entry in the IANA TZDB. 'Attendees' should be a comma-separated list of emails.
>
> *Optional* `$accessToken`: Helpful when you need to manually set a user's access token (e.g. using API authentication rather than Web). Defaults to 'google\_access\_token' column in the `users` table.

#### createEvent($request)

[](#createeventrequest)

> **Required** `$request`: The request object should contain a value for 'calendarId', 'summary', 'location', 'description', 'allDay', 'start', and 'end'. The 'timezone' and 'attendees' are optional. 'Timezone' should be formatted according to the corresponding entry in the IANA TZDB. 'Attendees' should be a comma-separated list of emails.
>
> *Optional* `$accessToken`: Helpful when you need to manually set a user's access token (e.g. using API authentication rather than Web). Defaults to 'google\_access\_token' column in the `users` table.

#### deleteEvent($request)

[](#deleteeventrequest)

> **Required** `$request`: The request object should contain a value for 'calendarId' and 'eventId'.
>
> *Optional* `$accessToken`: Helpful when you need to manually set a user's access token (e.g. using API authentication rather than Web). Defaults to 'google\_access\_token' column in the `users` table.

### Expose API

[](#expose-api)

This package comes with a Controller that can be used (or you can create your own) in order to expose the above methods to an API. Here's a sample Routes definition to do this:

```
// Google Calendar API routes
Route::group([ 'prefix'=>'api/google' ], function () {
	Route::get('calendars', '\zaupita\GoogleCalendar\Controllers\GoogleCalendarController@listCalendars');
	Route::get('events', '\zaupita\GoogleCalendar\Controllers\GoogleCalendarController@listEvents');
	Route::put('events/{id}', '\zaupita\GoogleCalendar\Controllers\GoogleCalendarController@updateEvent');
	Route::post('events', '\zaupita\GoogleCalendar\Controllers\GoogleCalendarController@createEvent');
	Route::delete('events/{id}', '\zaupita\GoogleCalendar\Controllers\GoogleCalendarController@deleteEvent');

});
```

These routes definitions will expose API functionality at 'api/google/calendars' and 'api/google/events' that you can consume via AJAX calls on your front-end.

### FullCalendar.io Integration

[](#fullcalendario-integration)

You can configure this package to input and output data in a format that can be understood by [FullCalendar.io](http://fullcalendar.io). To do so, you can modify the 'format' property in the `google_calendar.php` config file as such:

```
return [
	//....

	'format' => 'fullcalendar',

	//....
];

```

Then, when you initialize FullCalendar.io, you can consume the API exposed by following the steps in the [Expose API](#expose-api) section above as such:

```
$('#calendar').fullCalendar({

  eventSources: [

    // your event source
    {
      url: 'api/google/events',
      type: 'GET',
      data: {
		calendar: 'primary', // define your google calendar id here
      },
      error: function() {
		alert('there was an error while fetching events!');
      }
    }

    // any other sources...

  ]

});
```

Finally
-------

[](#finally)

### Contributing

[](#contributing)

Feel free to create a fork and submit a pull request if you would like to contribute.

### Bug reports

[](#bug-reports)

Raise an issue on GitHub if you notice something broken.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

8

Last Release

1758d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7570525?v=4)[Rodrigo Zaupa](/maintainers/zaupita)[@zaupita](https://github.com/zaupita)

---

Top Contributors

[![zaupita](https://avatars.githubusercontent.com/u/7570525?v=4)](https://github.com/zaupita "zaupita (13 commits)")

---

Tags

apilaravelgooglecalendar

### Embed Badge

![Health badge](/badges/zaupita-laravel-google-calendar/health.svg)

```
[![Health](https://phpackages.com/badges/zaupita-laravel-google-calendar/health.svg)](https://phpackages.com/packages/zaupita-laravel-google-calendar)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[mbarwick83/shorty

Google Url Shortener API Package for Laravel 5.1

31204.9k](/packages/mbarwick83-shorty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
