Download the PHP package zaupita/laravel-google-calendar without Composer

On this page you can find all versions of the php package zaupita/laravel-google-calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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.

Installation

This package can be used in Laravel 5.4 or higher.

You can install the package via composer:

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:

You can now publish the migration and config files and migrate updates to the user table with:

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' migration file (published by the above command). Then, re-run your migration using php artisan migrate.

Success! laravel-google-calendar is now installed!

Configuration

The first step to properly configure laravel-google-calendar, you need Google API credentials. You can obtain these credentials at https://console.developers.google.com/apis/credentials/oauthclient/.

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

Usage

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

Available Methods

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()

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

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()

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)

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)

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)

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

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:

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

You can configure this package to input and output data in a format that can be understood by 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 section above as such:

Finally

Contributing

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

Bug reports

Raise an issue on GitHub if you notice something broken.


All versions of laravel-google-calendar with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
laravel/framework Version ~6.20.27
google/apiclient Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zaupita/laravel-google-calendar contains the following files

Loading the files please wait ....