PHPackages                             deshack/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. deshack/laravel-google-calendar

AbandonedArchivedLibrary[API Development](/categories/api)

deshack/laravel-google-calendar
===============================

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

023PHP

Since Aug 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/deshack/laravel-google-calendar)[ Packagist](https://packagist.org/packages/deshack/laravel-google-calendar)[ RSS](/packages/deshack-laravel-google-calendar/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)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 hackeresq/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' => [
    // ...
    hackerESQ\GoogleCalendar\GoogleCalendarServiceProvider::class,
];

// ...

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

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

```
php artisan vendor:publish --provider="hackerESQ\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/hackerESQ/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', '\hackerESQ\GoogleCalendar\Controllers\GoogleCalendarController@listCalendars');
	Route::get('events', '\hackerESQ\GoogleCalendar\Controllers\GoogleCalendarController@listEvents');
	Route::put('events/{id}', '\hackerESQ\GoogleCalendar\Controllers\GoogleCalendarController@updateEvent');
	Route::post('events', '\hackerESQ\GoogleCalendar\Controllers\GoogleCalendarController@createEvent');
	Route::delete('events/{id}', '\hackerESQ\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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3a1b884cd809f2837c130834b8c3600b3b4edbac19d206ab254f24c6d1b323f?d=identicon)[deshack](/maintainers/deshack)

---

Top Contributors

[![hackeresq](https://avatars.githubusercontent.com/u/16628119?v=4)](https://github.com/hackeresq "hackeresq (16 commits)")[![deshack](https://avatars.githubusercontent.com/u/2034213?v=4)](https://github.com/deshack "deshack (2 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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