PHPackages                             pkboom/google-sheets - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pkboom/google-sheets

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pkboom/google-sheets
====================

00PHP

Since Aug 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pkboom/google-sheets)[ Packagist](https://packagist.org/packages/pkboom/google-sheets)[ RSS](/packages/pkboom-google-sheets/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Manage Google Sheets for Laravel applications
=============================================

[](#manage-google-sheets-for-laravel-applications)

[![Latest Stable Version](https://camo.githubusercontent.com/0c4fd9cf112c981a1a70d166bef020627c83ffdf78c193de28601cdb0ace6aa1/68747470733a2f2f706f7365722e707567782e6f72672f706b626f6f6d2f676f6f676c652d7368656574732f76)](//packagist.org/packages/pkboom/google-sheets)[![Total Downloads](https://camo.githubusercontent.com/4e0d8e13f75222dc5ca6f014de527800097d85e0cba433867b4399a3a20bae6e/68747470733a2f2f706f7365722e707567782e6f72672f706b626f6f6d2f676f6f676c652d7368656574732f646f776e6c6f616473)](//packagist.org/packages/pkboom/google-sheets)

This package makes working with Google Sheets a breeze. Once it has been set up you can do these things:

```
namespace Pkboom\GoogleSheets\GoogleSheetsFactory;

$sheets = GoogleSheetsFactory::create();

$response = $sheets->spreadsheetId('spreadsheet id')
    ->range('sheet-name!A2:E4')
    ->get();
```

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

[](#installation)

You can install the package via composer:

```
composer require pkboom/google-sheets
```

You must publish the configuration with this command:

```
php artisan vendor:publish --provider="Pkboom\GoogleStorage\GoogleSheetsServiceProvider"
```

This will publish a file called google-storage.php in your config-directory with these contents:

```
return [
    /*
     * Set access type, default: online
     */
    'access_type' => 'online',
    /*
     * Set cache key. When GOOGLE_CLIENT is created, it will retrieve the token from cache using this key.
     */
    'access_token_key' => 'google_sheet_token',
];
```

How to obtain a token using Socialite
-------------------------------------

[](#how-to-obtain-a-token-using-socialite)

```
use Google_Service_Sheets;

class GoogleLoginController extends Controller
{
    public function login()
    {
        return Socialite::driver('google')
            ->scopes(Google_Service_Sheets::SPREADSHEETS)
            ->redirect();
    }

    public function handleProviderCallback()
    {
        Cache::put('google_sheet_token', Socialite::driver('google')->user()->token, 3600);

        return Redirect::to('/');
    }
}
```

Usage
-----

[](#usage)

### Get data from a sheet

[](#get-data-from-a-sheet)

```
$response = $sheets->spreadsheetId(Request::input('spreadsheet'))
    ->range('legislators-current!A2:E4')
    ->get();

if (empty($response)) {
    ...
} else {
    ...
}
```

### Create a sheet

[](#create-a-sheet)

```
$sheets = GoogleSheetsFactory::create();

$spreadsheet = $sheets->create('title');

return $spreadsheet->spreadsheetId;
```

### Get a client from google sheets

[](#get-a-client-from-google-sheets)

You can set a new token key to the client

```
$sheets = GoogleSheetsFactory::create();

$sheets->getClient()->setAccessToken('new key');
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5c267544335ffc241b0287e8fe001a7c2cc8e466be886226fce5c744f2e1abe?d=identicon)[pkboom](/maintainers/pkboom)

---

Top Contributors

[![pkboom](https://avatars.githubusercontent.com/u/13960169?v=4)](https://github.com/pkboom "pkboom (3 commits)")

### Embed Badge

![Health badge](/badges/pkboom-google-sheets/health.svg)

```
[![Health](https://phpackages.com/badges/pkboom-google-sheets/health.svg)](https://phpackages.com/packages/pkboom-google-sheets)
```

###  Alternatives

[zertex/avatar-generator

Avatar generator by username, file or url.

104.5k1](/packages/zertex-avatar-generator)

PHPackages © 2026

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