2017 © Pedro Peláez
 

library google-core

Laravel 5 Google Core

image

ozankurt/google-core

Laravel 5 Google Core

  • Friday, November 4, 2016
  • by OzanKurt
  • Repository
  • 2 Watchers
  • 1 Stars
  • 4,670 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

Google Core

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

A package to keep all the required google setup together and ready., (*2)

Installation

Step 1

Add ozankurt/google-core to your composer requirements., (*3)

composer require ozankurt/google-core

Getting ready to use

Step 1

Create a google developer account which as actually logging in to any of your google accounts., (*4)

From https://developers.google.com/console/., (*5)

Step 2

Create a new project., (*6)

PS: Skip this step if you already have one., (*7)

New Project, (*8)

Step 3

Create a new Client ID, type should be Service Account, (*9)

PS: Skip this step if you already have one., (*10)

Create a new Client ID Service Account, (*11)

Step 4

Generate new P12 key and download it., (*12)

PS: Skip this step if you already have one., (*13)

Step 5

Copy the P12 file somewhere be used in php., (*14)

Configuration (Pure PHP)

Example Configuration File

<?php

require 'vendor/autoload.php';

use Kurt\Google\Core;
use Kurt\Google\Analytics;

$googleCore = new Core([
    'applicationName'       => 'MyProject',
    'p12FilePath'           => 'MyProject-1b6e6bbb8826.p12',
    'serviceClientId'       => '122654635465-u7io2injkjniweklew48knh7158.apps.googleusercontent.com',
    'serviceAccountName'    => '122654635465-u7io2injkjniweklew48knh7158@developer.gserviceaccount.com',
    'scopes' => [
        //
    ],
]);

Configuration (Laravel)

Step 1

Add the service provider to you config/app.php., (*15)

'providers' => [
    Kurt\Google\CoreServiceProvider::class,
],

Step 2

Run vendor:publish command from your terminal., (*16)

php artisan vendor:publish

Step 3

Edit the fields in the configuration file., (*17)

<?php

return [

    /**
     * Application Name
     *
     * Name of your project in `https://console.developers.google.com/`.
     */
    'applicationName' => 'MyProject',

    /**
     * P12 File
     *
     * After creating a project, go to `APIs & auth` and choose `Credentials` section.
     * 
     * Click `Create new Client ID` and select `Service Account` choose `P12` as the `Key Type`.
     *
     * After downloading the `p12` file copy and paste it in the `storage` directory.
     *      Example:
     *          storage/MyProject-2a4d6aaa4413.p12
     * 
     */
    'p12FilePath' => 'MyProject-2a4d6aaa4413.p12',

    /**
     * You will find this information under `Service Account` > `Client ID`
     *
     *      Example:
     *          122654635465-u7io2injkjniweklew48knh7158.apps.googleusercontent.com
     */
    'serviceClientId' => '',

    /**
     * You will find this information under `Service Account` > `Email Address`
     *
     *      Example:
     *          122654635465-u7io2injkjniweklew48knh7158@developer.gserviceaccount.com
     */
    'serviceAccountName' => '',

    /**
     * Here you should pass an array of needed scopes depending on what service you will be using.
     *
     *      Example:
     *          For analytics service:
     *          
     *              'scopes' => [
     *                  'https://www.googleapis.com/auth/analytics.readonly',
     *              ],
     */
    'scopes' => [
        //
    ],

];

License

This open-sourced is software licensed under the MIT license., (*18)

The Versions

04/11 2016

2.0.x-dev

2.0.9999999.9999999-dev

Laravel 5 Google Core

  Sources   Download

MIT

The Requires

 

laravel api core google

04/11 2016

v2.0

2.0.0.0

Laravel 5 Google Core

  Sources   Download

MIT

The Requires

 

laravel api core google

04/11 2016

dev-master

9999999-dev

Laravel 5 Google Core

  Sources   Download

MIT

The Requires

 

laravel api core google

09/07 2015

v1.0

1.0.0.0

Laravel 5 Google Core

  Sources   Download

MIT

The Requires

 

laravel api core google