PHP code example of mkohei / laravel-google-sheets-notification-channel

1. Go to this page and download the library: Download mkohei/laravel-google-sheets-notification-channel 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/ */

    

mkohei / laravel-google-sheets-notification-channel example snippets


'google' => [
    'sheets' => [
        'client_id' => env('INTEGRATIONS_GOOGLE_SHEETS_CLIENT_ID'),
        'client_secret' => env('INTEGRATIONS_GOOGLE_SHEETS_CLIENT_SECRET'),
    ],
],

/*
 * Package Service Providers...
 */
Mkohei\LaravelGoogleSheetsNotificationChannel\GoogleSheetsServiceProvider::class,

use Mkohei\LaravelGoogleSheetsNotificationChannel\GoogleSheetsChannel;
use Mkohei\LaravelGoogleSheetsNotificationChannel\GoogleSheetsMessage;
use Illuminate\Notifications\Notification;

class ProjectCreated extends Notification
{
    public function via($notifiable)
    {
        return [GoogleSheetsChannel::class];
    }

    public function toGoogleSheets($notifiable)
    {
        return TreasureDataMessage::create()
            ->data(['value1', 'value2'])
            ->accessToken('your-access-token')
            ->spreadsheetId('id');
    }
}