PHP package to manage google-api interactions

Overview

Google-api-client

PHP package to manage google-api interactions

Supports:

  • Google Drive API
  • Google Spreadsheet API

Installation

composer require obrio-team/google-api-client

Config:

  • Provide auth credential configs for native google-apiclient library
  • Enable dependency injection. E.g. Symfony config.yaml
services:
    ObrioTeam\GoogleApiClient\:
        resource: '../vendor/obrio-team/google-api-client/src'
  • If you would like to define your custom ItemStatusService` statuses inject delimiter and your custom status extensions. E.g. Symfony config.yaml
services:
  ObrioTeam\GoogleApiClient\Service\ItemStatus\GoogleItemStatusService:
    class: ObrioTeam\GoogleApiClient\Service\ItemStatus\GoogleItemStatusService
    arguments:
      - ':' #delimiter
      - [
          '@App\Domain\Statuses\CustomStatusOne' #implementation
      ]

Google drive service

Method Arguments Output Description
getFile string $fileId, array $optionalParam = [] ?Google_Service_Drive_DriveFile Get single Google drive file by its ID or null.
createFile Google_Service_Drive_DriveFile $file, array $optionalParams = [] ?Google_Service_Drive_DriveFile Try to create file with locally created DriveFile object
updateFile string $fileId, Google_Service_Drive_DriveFile $file, array $optionalParams = [] ?Google_Service_Drive_DriveFile Try to update file with locally created DriveFile object
getFilteredFileList ?string $folderId = null, bool $deepPagination = false, ?GoogleItemRuleStrategyInterface ...$itemRuleStrategies array Get list of files. If set deepPagination=true all files through google pagination will be matched. Also you can perform filtering by various strategies
exportFileContent string $fileId, string $mimeType = 'text/plain', array $optionalParams = [] \GuzzleHttp\Psr7\Request Get content of GoogleDoc file in desired format by file ID
getNonGoogleDocsFileContent string $fileId \GuzzleHttp\Psr7\Request Get contents of non-GoogleDoc file by file ID
changeFileStatus Google_Service_Drive_DriveFile $file, ContentStatusAbstract $targetStatus ?Google_Service_Drive_DriveFile Try to update file name with status using GoogleItemStatusService

Google spreadsheet service

Method Arguments Output Description
getJustNewValues string $spreadsheetId, string $range = '' GoogleSheetValuesResponse Get only updated values as DTO with key=>value array
getSheets string $spreadsheetId GoogleSheetSheetsResponse Get DTO with list of spreadsheet sheets
getValues string $spreadsheetId, ?string $sheetTitle = null, string $range = '' GoogleSheetValuesResponse Get sheet values as DTO with key=>value array. If no sheetTitle defined - getting values from first sheet in spreadsheet. Specific range can set.
updateField string $spreadsheetId, UpdateFieldRequest $updateFieldRequest Google_Service_Sheets_UpdateValuesResponse Update single cell value
updateRange string $spreadsheetId, UpdateRangeRequest $updateRangeRequest Google_Service_Sheets_UpdateValuesResponse Update range request in specified sheet.
addSpreadsheetPage string $spreadsheetId, AddSpreadsheetPageRequest $addSpreadsheetPageRequest Google_Service_Sheets_BatchUpdateSpreadsheetResponse Add new sheet to the spreadsheet.
appendDimensionToSpreadsheetPage string $spreadsheetId, AppendDimensionToSpreadsheetPageRequest $appendDimensionToSpreadsheetPageRequest Google_Service_Sheets_BatchUpdateSpreadsheetResponse Append colimns or rows to the specific sheet of the spreadsheet.
createGoogleSpreadsheet string $name, ?string $parentFolderId = null Google_Service_Sheets_Spreadsheet Create new spreadsheet file in defined parent folder.
appendRows string $spreadsheetId, AppendRowsRequest $appendRowsRequest Google_Service_Sheets_AppendValuesResponse Append one or more rows to the end of table on spreadsheet.

Hints

To get all mentioned ...Request DTOs use this factories:

\ObrioTeam\GoogleApiClient\Factory\GoogleDriveFileFactory::class;
\ObrioTeam\GoogleApiClient\Factory\GoogleSpreadsheetRequestFactory::class;
You might also like...
A versatile PHP Library for Google PageSpeed Insights

PhpInsights An easy-to-use API Wrapper for Googles PageSpeed Insights. The JSON response is mapped to objects for an headache-free usage. Installation

Google Cloud Profiler for PHP

Google Cloud Profiler for PHP Idiomatic PHP client for Google Cloud Profiler. API documentation NOTE: This repository is part of Google Cloud PHP. Any

Adds a specific header to every response to disable Google's usage of your site in it's FLoC tracking method.

Go Unfloc Yourself Description A bundle for Symfony 5 that adds a Permissions-Policy header in all the responses to prevent the use of new Google's "F

🌏 Discover Random Destinations & Cities explored by people on Google Street View.
🌏 Discover Random Destinations & Cities explored by people on Google Street View.

Random Street View on Steroids 👀 Welcome to the streetviewhub.com codebase. Here lies all the code with all the awesomeness and 🐛 s. Have some ideas

Paperwork - OpenSource note-taking & archiving alternative to Evernote, Microsoft OneNote & Google Keep
Paperwork - OpenSource note-taking & archiving alternative to Evernote, Microsoft OneNote & Google Keep

Paperwork Paperwork is an open-source, self-hosted alternative to services like Evernote®, Microsoft OneNote® or Google Keep® iframe src="https://pla

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Manage newsletters in Laravel
Manage newsletters in Laravel

Manage newsletters in Laravel This package provides an easy way to integrate MailChimp with Laravel. Should you find that Mailchimp is too expensive f

Create and manage advanced polls with this Telegram Bot which has many features available!
Create and manage advanced polls with this Telegram Bot which has many features available!

MasterPollBot Create and manage advanced polls with this Telegram Bot which has many features available! Requirements Local Telegram Bot API or a webh

PHP package for the Limg.app website - allowing to upload images via the API of the website.
PHP package for the Limg.app website - allowing to upload images via the API of the website.

Limg PHP Client Package. Installation You can install the package via composer: composer require havenstd06/limg-php-client Usage use Havenstd06\Limg\

Comments
  • Merge DEV branch progress to active MAIN branch

    Merge DEV branch progress to active MAIN branch

    Basic logic:

    1. Google Drive API local client
    2. Google Spreadsheet API local client
    3. Google Drive service
    4. Google Spreadsheet service
    5. GoogleItemStatusService
    6. GoogleItemRuleFilterService
    7. Factories
    opened by AlexZodov 0
Releases(0.1.4)
Owner
OBRIO
OBRIO Open Source Platform
OBRIO
🌐 Free Google Translate API PHP Package. Translates totally free of charge.

Google Translate PHP Free Google Translate API PHP Package. Translates totally free of charge. Installation Basic Usage Advanced Usage Language Detect

Levan Velijanashvili 1.5k Dec 31, 2022
Google PHP API Client Services

Google PHP API Client Services

Google APIs 1.1k Dec 22, 2022
Google Drive Api Wrapper by PHP

GoogleDrive Api Wrapper usage at first you need to create oauth client on google cloud platform. so go to the your google console dashboard and create

Arash Abedi 2 Mar 24, 2022
Google Translator Api Wrapper For Php Developers.

Google Translator Api Wrapper For Php Developers.

Roldex Stark 2 Oct 12, 2022
Attempting to create an intelligent mock of the Google API PHP Client for unit and functional testing

google-api-php-client-mock A small scale intelligent mock of the Google API PHP Client for unit and functional testing. Overview This is intended to m

SIL International 0 Jan 4, 2022
A Laravel package to retrieve pageviews and other data from Google Analytics

Retrieve data from Google Analytics Using this package you can easily retrieve data from Google Analytics. Here are a few examples of the provided met

Spatie 2.8k Jan 7, 2023
Google VerifiedSMS Laravel Package

Google VerifiedSMS Laravel Package This is a laravel package developed for google business communication api and verified SMS API. Before we commence

Saju G 2 Nov 22, 2021
An elegant wrapper around Google Vision API

STILL UNDER DEVELOPMENT - DO NOT USE IN PRODUCTION Requires PHP 8.0+ For feedback, please contact me. This package provides an elegant wrapper around

Ahmad Mayahi 24 Nov 20, 2022
Simple Google Tts Api Class

Simple Google Tts Api Class

Ömer Faruk Demirel 2 Dec 2, 2022
It's a PHP Application to simplify working with Google Sheets SDK for php.

About GoogleSheetsPHP It's a PHP Application to simplify working with Google Sheets SDK for php. Note: i used Slim 3 to construct the application but

Sami Alateya 5 Dec 20, 2022