PHPackages                             zuko/syncro-sheet - 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. [Database &amp; ORM](/categories/database)
4. /
5. zuko/syncro-sheet

ActiveLibrary[Database &amp; ORM](/categories/database)

zuko/syncro-sheet
=================

Laravel Eloquent and Google Sheets synchronization package

1.0(1y ago)110[2 issues](https://github.com/ultra-bugs/syncro-sheet/issues)MITPHPPHP ^8.1

Since Nov 2Pushed 4mo agoCompare

[ Source](https://github.com/ultra-bugs/syncro-sheet)[ Packagist](https://packagist.org/packages/zuko/syncro-sheet)[ RSS](/packages/zuko-syncro-sheet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

WIP
===

[](#wip)

This package is not avail on packagist yet. If you interesting, take a local clone or zip download then try it out.

SyncroSheet
===========

[](#syncrosheet)

Laravel package for efficient synchronization between your models and Google Sheets with advanced state tracking and error handling.

Features
--------

[](#features)

- 🔄 Sync from Laravel models to Google Sheets. Bidirectional sync is planned to implement
- 📦 Batch processing with memory efficiency
- 🎯 Support for both full and partial syncs
- 💾 Sophisticated state tracking and resume capability
- 🔁 Automatic retry mechanism with exponential backoff
- 📊 Detailed sync history and progress tracking
- 🚨 Comprehensive notification system
- 🔑 Smart token management for Google API

Requirements
------------

[](#requirements)

- PHP `>= 8.1`
- Laravel `>= 10`
- Google API accessible

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

[](#installation)

```
composer require zuko/syncro-sheet
```

Publish the configuration and migrations:

```
php artisan vendor:publish --provider="Zuko\SyncroSheet\LaravelSyncroSheetProvider"
php artisan migrate
```

Configuration
-------------

[](#configuration)

### Google Sheets Setup

[](#google-sheets-setup)

1. Create a Google Cloud Project
2. Enable Google Sheets API
3. Create credentials (OAuth 2.0 or Service Account)
4. Set up your .env file:

```
GOOGLE_SHEETS_CLIENT_ID=your-client-id
GOOGLE_SHEETS_CLIENT_SECRET=your-client-secret
GOOGLE_SHEETS_REDIRECT_URI=your-redirect-uri
```

Or using service account:

```
GOOGLE_DEVELOPER_KEY=your-service-account-key
GOOGLE_SERVICE_ENABLED=true
```

As a wrapped around `revolution/laravel-google-sheets`. these env vars is taken from `config/google.php`

If you already set these authorization values. You can leave env untouched.

### Package Configuration

[](#package-configuration)

```
// config/syncro-sheet.php

return [
    'defaults' => [
        'batch_size' => 1000,
        'timeout' => 600,
        'retries' => 3
    ],
    // ... other configurations
];
```

Basic Usage
-----------

[](#basic-usage)

### 1. Make Your Model Sync-able

[](#1-make-your-model-sync-able)

```
use Zuko\SyncroSheet\Contracts\SheetSyncable;

class Product extends Model implements SheetSyncable
{
    public function getSheetIdentifier(): string
    {
        return '1234567890-your-google-sheet-id';
    }

    public function getSheetName(): string
    {
        return 'Products';
    }

    public function toSheetRow(): array
    {
        return [
            $this->id,
            $this->name,
            $this->price,
            $this->stock,
            $this->updated_at->format('Y-m-d H:i:s')
        ];
    }

    public function getBatchSize(): ?int
    {
        return 500; // Optional, defaults to config value
    }
}
```

### 2. Run Sync Operations

[](#2-run-sync-operations)

```
use Zuko\SyncroSheet\Services\SyncManager;

// Full sync
$syncManager = app(SyncManager::class);
$syncState = $syncManager->fullSync(Product::class);

// Partial sync
$syncState = $syncManager->partialSync(Product::class, [1, 2, 3]);
```

Or using facade static call

```
use SyncroSheet;
// or
use Zuko\SyncroSheet\Facades\SyncroSheet;

// Full sync
$syncState = SyncroSheet::fullSync(Product::class);

// Partial sync
$syncState = SyncroSheet::partialSync(Product::class, [1, 2, 3]);

// Get last sync state
$lastSync = SyncroSheet::getLastSync(Product::class);
```

### 3. Artisan Commands

[](#3-artisan-commands)

```
# Full sync
php artisan sheet:sync Product

# Partial sync
php artisan sheet:sync Product --ids=1,2,3
```

Advanced Usage
--------------

[](#advanced-usage)

### 1. Custom Data Transformation

[](#1-custom-data-transformation)

```
use Zuko\SyncroSheet\Services\DataTransformer;

class ProductTransformer extends DataTransformer
{
    protected function transformRecord(SheetSyncable $record): array
    {
        return [
            'ID' => $record->id,
            'Product Name' => $record->name,
            'Price' => number_format($record->price, 2),
            'In Stock' => $record->stock > 0 ? 'Yes' : 'No',
            'Last Updated' => $record->updated_at->format('Y-m-d H:i:s')
        ];
    }
}
```

### 2. Event Listeners

[](#2-event-listeners)

```
use Zuko\SyncroSheet\Events\SyncEvent;

Event::listen(SyncEvent::SYNC_STARTED, function ($syncState) {
    Log::info("Sync started for {$syncState->model_class}");
});

Event::listen(SyncEvent::SYNC_COMPLETED, function ($syncState) {
    Log::info("Sync completed: {$syncState->total_processed} records");
});
```

### 3. Custom Notifications

[](#3-custom-notifications)

```
use Zuko\SyncroSheet\Notifications\BaseNotification;

class CustomSyncNotification extends BaseNotification
{
    protected function getMailMessage(): MailMessage
    {
        return (new MailMessage)
            ->subject('Custom Sync Notification')
            ->line('Your custom notification logic here');
    }

    protected function getSlackMessage(): SlackMessage
    {
        return (new SlackMessage)
            ->content('Custom Slack notification');
    }
}
```

### 4. State Management

[](#4-state-management)

```
use Zuko\SyncroSheet\Services\StateManager;

$stateManager = app(StateManager::class);

// Get last successful sync
$lastSync = $stateManager->getLastSuccessfulSync(Product::class);

// Get sync history
$syncHistory = \Zuko\SyncroSheet\Models\SyncState::where('model_class', Product::class)
    ->with('entries')
    ->latest()
    ->get();
```

### 5. Error Handling

[](#5-error-handling)

```
use Zuko\SyncroSheet\Services\ErrorHandler;

try {
    $syncManager->fullSync(Product::class);
} catch (GoogleSheetsException $e) {
    // Handle Google Sheets specific errors
} catch (SyncException $e) {
    // Handle general sync errors
}
```

Best Practices
--------------

[](#best-practices)

1. **Batch Size**: Adjust based on your model's complexity and memory constraints

```
public function getBatchSize(): int
{
    return $this->hasMedia() ? 100 : 1000;
}
```

2. **Rate Limiting**: Configure based on your Google Sheets API quotas

```
// config/syncro-sheet.php
'sheets' => [
    'rate_limit' => [
        'max_requests' => 100,
        'per_seconds' => 60
    ]
]
```

3. **Error Handling**: Implement custom notification channels

```
use Zuko\SyncroSheet\Notifications\SyncFailedNotification;

class SlackSyncNotifier extends Notification
{
    public function toSlack($notifiable)
    {
        // Custom Slack notification logic
    }
}
```

Contributing
------------

[](#contributing)

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

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance40

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

559d ago

### Community

Maintainers

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

---

Top Contributors

[![tansautn](https://avatars.githubusercontent.com/u/6666271?v=4)](https://github.com/tansautn "tansautn (11 commits)")

---

Tags

google-sheets-librarygoogle-sheets-synclaravel-sheetslaravel-sync

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/zuko-syncro-sheet/health.svg)

```
[![Health](https://phpackages.com/badges/zuko-syncro-sheet/health.svg)](https://phpackages.com/packages/zuko-syncro-sheet)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

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