PHPackages                             basecardhero/spreadsheet - 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. basecardhero/spreadsheet

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

basecardhero/spreadsheet
========================

A Google services wrapper library for creating Google Sheets.

v0.3.0(7y ago)046MITPHPPHP ^7.1CI failing

Since Feb 24Pushed 7y agoCompare

[ Source](https://github.com/basecardhero/spreadsheet)[ Packagist](https://packagist.org/packages/basecardhero/spreadsheet)[ Docs](https://github.com/basecardhero/spreadsheet)[ RSS](/packages/basecardhero-spreadsheet/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

BaseCardHero - Spreadsheet
==========================

[](#basecardhero---spreadsheet)

[![Build Status](https://camo.githubusercontent.com/a66d8d2f07a175505160c8d7fc01806e0a3d965d3326b607e5be1468f030694e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62617365636172646865726f2f73707265616473686565742f6d61737465722e737667)](https://travis-ci.org/basecardhero/spreadsheet)[![codecov](https://camo.githubusercontent.com/f24f4a041d2c8dd48f391b5c03df25df15a05f32b72b5ab0b5c88b74e5859637/68747470733a2f2f636f6465636f762e696f2f67682f62617365636172646865726f2f73707265616473686565742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/basecardhero/spreadsheet)[![License](https://camo.githubusercontent.com/8e9a1f9559f8297ddb387df882ab9719041254e5e5fda573295313368842c799/68747470733a2f2f706f7365722e707567782e6f72672f62617365636172646865726f2f73707265616473686565742f6c6963656e73653f633d30)](https://packagist.org/packages/basecardhero/spreadsheet)[![composer.lock](https://camo.githubusercontent.com/fda5b057d7b4d7647b2db75b620a61638968dddf1ad8e1d2faf6880806f53c7a/68747470733a2f2f706f7365722e707567782e6f72672f62617365636172646865726f2f73707265616473686565742f636f6d706f7365726c6f636b)](https://packagist.org/packages/basecardhero/spreadsheet)

*This package was created for a project I am working on and does not fully support Google services (or the way you may want it to). Feel free to add functionality by creating a pull request. See [contributing](CONTRIBUTING.md).*

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

[](#installation)

You can install the package via [composer](https://getcomposer.org/):

```
$ composer require basecardhero/spreadsheet
```

Usage
-----

[](#usage)

You will need to configure the [Google Client](https://github.com/googleapis/google-api-php-client). See [gsuitedevs/php-samples](https://github.com/gsuitedevs/php-samples) for examples configuring a Google Client for php.

### Examples

[](#examples)

#### Create a Spreadsheet instance

[](#create-a-spreadsheet-instance)

```
require_once '/project/path/vendor/autoload.php';

$client = new \Google_Client(); // Make sure to configure your Google client.
$sheetService = new \Google_Service_Sheets($client);
$spreadsheet = new \BaseCardHero\Spreadsheet\Spreadsheet($sheetService);
```

#### Create a spreadsheet

[](#create-a-spreadsheet)

The `create()` method will fetch a new spreadsheet from the rest service.

```
$spreadsheet->create()
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Retrieve a spreadsheet

[](#retrieve-a-spreadsheet)

The `retrieve()` method will fetch an existing spreadsheet from the rest service.

```
$spreadsheetId = '1b7c48b64ef1d5bf093632e7f8aa6529';

$spreadsheet->retrieve($spreadsheetId)
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Set the title

[](#set-the-title)

```
$spreadsheet->create()
    ->setTitle('My Spreadsheet Title')
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Set column data

[](#set-column-data)

```
$columns = [
    [
        'range' => 'A1:A',
        'values' => [0, 1, 2, 3]
    ],
    [
        'range' => 'B1:B',
        'values' => ['a', 'b', 'c', 'd']
    ],
];

$spreadsheet->create()
    ->setColumns($columns)
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Clearing data on a spreadsheet

[](#clearing-data-on-a-spreadsheet)

```
$spreadsheet->create()
    ->clearRanges(['A1:A', 'B1:B'])
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Copying a sheet from another spreadsheet

[](#copying-a-sheet-from-another-spreadsheet)

```
$otherSpreadsheetId = '635d0d664ff92db666a9be5ed84f231c';
$otherSheetId = 0;

$spreadsheet->create()
    ->copySheetFrom($otherSpreadsheetId, $otherSheetId)
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

#### Delete a sheet within the spreadsheet

[](#delete-a-sheet-within-the-spreadsheet)

```
$sheetId = 0;

$spreadsheet->create()
    ->deleteSheet($sheetId)
    ->getSpreadsheet(); // \Google_Service_Sheets_Spreadsheet
```

### Testing

[](#testing)

```
$ composer all
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

### Contributing

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Base Card Hero](https://github.com/basecardhero) | [basecardhero.com](https://basecardhero.com/)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.2% 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 ~8 days

Total

3

Last Release

2619d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29577813?v=4)[Base Card Hero](/maintainers/basecardhero)[@basecardhero](https://github.com/basecardhero)

---

Top Contributors

[![basecardhero](https://avatars.githubusercontent.com/u/29577813?v=4)](https://github.com/basecardhero "basecardhero (23 commits)")[![rfmeier](https://avatars.githubusercontent.com/u/1128283?v=4)](https://github.com/rfmeier "rfmeier (4 commits)")

---

Tags

google-sheets

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/basecardhero-spreadsheet/health.svg)

```
[![Health](https://phpackages.com/badges/basecardhero-spreadsheet/health.svg)](https://phpackages.com/packages/basecardhero-spreadsheet)
```

###  Alternatives

[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)[tomatophp/filament-seo

Manage and generate SEO tags and integrate your website with Google SEO services

112.6k1](/packages/tomatophp-filament-seo)

PHPackages © 2026

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