PHP code example of ozankurt / google-core

1. Go to this page and download the library: Download ozankurt/google-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ozankurt / google-core example snippets


composer 



urt\Google\Core;

$googleCore = new Core([
    'applicationName'       => 'Google API Wrapper Demo',
    'jsonFilePath'          => 'Google API Wrapper Demo-174e172143a9.json',
    'scopes' => [
        // 
    ],
]);

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



return [

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

    /*
     * Json Auth File Path
     *
     * 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/Google API Wrapper Demo-174e172143a9.json
     * 
     */
    'jsonFilePath' => storage_path('Google API Wrapper Demo-174e172143a9.json'),

    /*
     * 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' => [
        //
    ],

];


php artisan vendor:publish