PHPackages                             eng-mahmoud-elgml/google-integration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. eng-mahmoud-elgml/google-integration

ActiveLibrary[File &amp; Storage](/categories/file-storage)

eng-mahmoud-elgml/google-integration
====================================

This Package To Make Integration With Google Drive And Google sheets Very Simple

1.2.4(2y ago)05PHPCI passing

Since Mar 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/EngMahmoudElgml/google-integration)[ Packagist](https://packagist.org/packages/eng-mahmoud-elgml/google-integration)[ RSS](/packages/eng-mahmoud-elgml-google-integration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

Google Integration
==================

[](#google-integration)

Overview
--------

[](#overview)

This is a laravel laravel-package to help in google integration with two main services.

- Google Drive
- Google Sheets

---

Installation
------------

[](#installation)

install it with CL:
`composer require eng-mahmoud-elgml/google-integration`
run `php artisan vendor:publish --provider="EngMahmoudElgml\GoogleIntegration\Providers\GoogleServiceProvide" --tag="config"`

by default the package is handle google callback and return access token, but you can override on it and use your own route and callback function and all you need in callback function is create object from `GoogleConnection`Class and use `handleCallback()` method and pass `$request['code']` to it which will return access token

Now Create Your Google Project in google developers console and get the Oauth2-credentials and download it as a json file get the values from the file and set it in google config file or .env file.

Also, You Will find in config/google.php an array called token you will get it after log in with Google Account , to get google login link:
you can create an object from `GoogleConnection` Class and use `getAuthUrl` methode to get the link

after login if the package handled google-callback itself: you will get the access token directly after login, copy its values and paste it inside `token` array in `config/google.php`

Also, if you want to save the token in database you can pass your token manually when create any `GoogleFile` or `SpreadSheet` object as second parameter in constructor Now You Ready to Use The Package Features

Usage
-----

[](#usage)

### 1- Google Drive Features

[](#1--google-drive-features)

To use drive features you must create object from `GoogleFile` class and pass google file id in constructor then you can:
**a- copy it**
with `$googleFileObject->copy()` you can copy the file and if you want the copied one with specific name you can pass the name in first parameter, otherwise the name will be a random number.
and if you want it in specific folder you can pass the folder id in second parameter.
**b- export it**
with `$googleFileObject->export()` you can export the file content with default mime type `application/pdf` and if you want to change it you can pass mime type in first parameter. but first take a look at: [Supported mime types from Google](https://developers.google.com/drive/api/guides/ref-export-formats)
And if you want to save it directly to your local disk you can pass the second parameter as your path and third one as file name.
**c- delete it**
with `$googleFileObject->delete()` you can delete the file.
**d- share it**
with `$googleFileObject->share($email,$role)` you can share the file with specific email and you can pass the role in second parameter as `reader` or `writer` or `owner`.

### 2- Google Sheets Features

[](#2--google-sheets-features)

To use Google Sheets features you must create object from `SpreadSheet` class and pass spreadsheet id in constructor then you can:
**a- List sheets in spreadsheet file**
with `$spreadSheetObject->list()` you can get all sheets in spreadsheet file.
**b- Get sheet data (Read the sheet)**
with `$spreadSheetObject->read($sheetName)` you can get all data in specific sheet in spreadsheet file. and you can get specific range of data by passing the range in second parameter.
Ex:

```
$spreadSheetObject->read('Sheet1','A1:B2');
```

**c- Update Cell Values**
with `$spreadSheetObject->updateCells($sheetName,$cellesWithItsValues)` you can update cell values in specific sheet in spreadsheet file.
Ex:

```
$spreadSheetObject->updateCells('Sheet1',[
    'A1'=>'value1',
    'B1'=>'value2',
    'A2'=>'value3',
    'B2'=>'value4',
]);
```

**d- Bulk Update To The Sheet**
if you want to update all the cells in the sheet you can use `$spreadSheetObject->override($sheetName,$data)` and pass the sheet name in first parameter and the data in second parameter as array of arrays. each array in the main array is a row in the sheet and each array inside it is a cell in the row. Ex:

```
$spreadSheetObject->override('Sheet1',[
    ['value1','value2'],
    ['value3','value4'],
]);
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance60

Regular maintenance activity

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~25 days

Total

11

Last Release

982d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/512e6c34ece6e48e9e33537a7471627d7a38d8439780dfb138bd22bd401090cc?d=identicon)[eng\_mahmoud\_elgml](/maintainers/eng_mahmoud_elgml)

---

Top Contributors

[![EngMahmoudElgml](https://avatars.githubusercontent.com/u/101332978?v=4)](https://github.com/EngMahmoudElgml "EngMahmoudElgml (13 commits)")[![AyaElgml](https://avatars.githubusercontent.com/u/149100936?v=4)](https://github.com/AyaElgml "AyaElgml (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/eng-mahmoud-elgml-google-integration/health.svg)

```
[![Health](https://phpackages.com/badges/eng-mahmoud-elgml-google-integration/health.svg)](https://phpackages.com/packages/eng-mahmoud-elgml-google-integration)
```

###  Alternatives

[nao-pon/flysystem-google-drive

Flysystem adapter for Google Drive

3672.0M20](/packages/nao-pon-flysystem-google-drive)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2631.7M14](/packages/masbug-flysystem-google-drive-ext)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
