PHPackages                             mannu24/google-merchant-center - 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. [API Development](/categories/api)
4. /
5. mannu24/google-merchant-center

ActiveLibrary[API Development](/categories/api)

mannu24/google-merchant-center
==============================

A comprehensive Laravel package for Google Merchant Center integration with product synchronization, batch processing, and automatic sync management.

1.0.2(8mo ago)11MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Aug 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/mannu24/laravel-google-merchant-center)[ Packagist](https://packagist.org/packages/mannu24/google-merchant-center)[ Docs](https://github.com/mannu24/laravel-google-merchant-center)[ RSS](/packages/mannu24-google-merchant-center/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Laravel Google Merchant Center Integration
==========================================

[](#laravel-google-merchant-center-integration)

A comprehensive Laravel package for seamless Google Merchant Center product synchronization with independent tables, batch processing, and automatic sync management.

Features
--------

[](#features)

- 🚀 **Product Synchronization** - Sync products with Google Merchant Center
- 📦 **Batch Processing** - Handle large datasets efficiently
- 🔄 **Automatic Sync** - Set up automated synchronization workflows
- 🎯 **Per-Product Control** - Enable/disable sync for individual products
- 📊 **Sync Logging** - Comprehensive tracking and monitoring
- 🛡️ **Error Handling** - Robust retry logic and error management
- ⚡ **Performance Optimized** - Rate limiting and caching
- 🔧 **Laravel Integration** - Seamless Laravel ecosystem integration

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

[](#requirements)

- PHP 8.0 or higher
- Laravel 8.x, 9.x, 10.x, 11.x, or 12.x
- Google Merchant Center account
- Google API credentials

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

[](#installation)

```
composer require mannu24/google-merchant-center
```

Quick Setup
-----------

[](#quick-setup)

1. **Publish configuration:**

```
php artisan vendor:publish --tag=gmc-config
```

2. **Publish migrations:**

```
php artisan vendor:publish --tag=gmc-migrations
```

3. **Run migrations:**

```
php artisan migrate
```

4. **Configure environment variables:**

```
GMC_MERCHANT_ID=your_merchant_id
GMC_SERVICE_ACCOUNT_JSON=/path/to/service-account.json
GMC_AUTO_SYNC=true
GMC_BATCH_SIZE=50
GMC_RETRY_ATTEMPTS=3
```

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

[](#basic-usage)

### 1. Add Trait to Your Product Model

[](#1-add-trait-to-your-product-model)

```
use Mannu24\GoogleMerchantCenter\Traits\SyncsWithGMC;

class Product extends Model
{
    use SyncsWithGMC;

    protected $fillable = [
        'title', 'description', 'price', 'quantity',
        'image_url', 'brand', 'sku', 'status'
    ];

    public function prepareGMCData(): array
    {
        return [
            'offerId' => $this->sku ?: (string) $this->id,
            'title' => $this->title,
            'description' => $this->description,
            'link' => url("/products/{$this->id}"),
            'imageLink' => $this->image_url,
            'price' => ['value' => (string) $this->price, 'currency' => 'USD'],
            'availability' => $this->quantity > 0 ? 'in stock' : 'out of stock',
            'brand' => $this->brand,
            'condition' => 'new'
        ];
    }
}
```

### 2. Sync Products

[](#2-sync-products)

```
// Manual sync
$product->syncToGMC();

// Force sync (ignores cache)
$product->forceSyncToGMC();

// Check sync status
if ($product->isSyncedWithGMC()) {
    echo "Product is synced!";
}
```

### 3. Bulk Operations

[](#3-bulk-operations)

```
use Mannu24\GoogleMerchantCenter\Services\GMCService;

$gmcService = app(GMCService::class);
$result = $gmcService->syncMultipleProducts($products, 25);
```

### 4. Artisan Commands

[](#4-artisan-commands)

```
# Sync all products
php artisan gmc:sync-all

# Sync with filters
php artisan gmc:sync-all --filter="status=active"

# Dry run (no actual sync)
php artisan gmc:sync-all --dry-run

# Force sync (ignore cache)
php artisan gmc:sync-all --force
```

Database Structure
------------------

[](#database-structure)

### `gmc_products` Table

[](#gmc_products-table)

- `product_id` - Reference to your product
- `product_type` - Model class name
- `sync_enabled` - Control sync per product
- `gmc_product_id` - GMC's product ID
- `gmc_last_sync` - Last sync timestamp
- `sync_status` - Current sync status
- `last_error` - Last error message

### `gmc_sync_logs` Table

[](#gmc_sync_logs-table)

- Tracks all sync attempts
- Stores request/response data
- Performance metrics
- Error details

Advanced Features
-----------------

[](#advanced-features)

### Batch Processing

[](#batch-processing)

```
$gmcService = app(GMCService::class);
$gmcService->setBatchSize(25);
$result = $gmcService->syncMultipleProducts($products);
```

### Error Handling

[](#error-handling)

```
try {
    $product->syncToGMC();
} catch (\Exception $e) {
    Log::error('GMC Sync failed: ' . $e->getMessage());
}
```

### Sync History

[](#sync-history)

```
use Mannu24\GoogleMerchantCenter\Models\GMCSyncLog;

$logs = GMCSyncLog::with('gmcProduct')->latest()->get();
$failedLogs = GMCSyncLog::where('status', 'failed')->get();
```

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

[](#configuration)

The package configuration file (`config/gmc.php`) includes:

- API credentials and endpoints
- Batch processing settings
- Retry and timeout configurations
- Logging preferences
- Cache settings

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Support
-------

[](#support)

- [GitHub Issues](https://github.com/mannu24/laravel-google-merchant-center/issues)
- [Documentation](https://github.com/mannu24/laravel-google-merchant-center)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance59

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~2 days

Total

2

Last Release

259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d049ffc03f8891810446723e9dbb02ae36ace1acbfe2dc8e17ec4f167b8aefa?d=identicon)[mannu24](/maintainers/mannu24)

---

Top Contributors

[![mannu24](https://avatars.githubusercontent.com/u/65483269?v=4)](https://github.com/mannu24 "mannu24 (7 commits)")

---

Tags

laravellaravel-packageecommerceproduct syncgoogle-shoppinggoogle-merchant-centergmcmerchant-center

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mannu24-google-merchant-center/health.svg)

```
[![Health](https://phpackages.com/badges/mannu24-google-merchant-center/health.svg)](https://phpackages.com/packages/mannu24-google-merchant-center)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)

PHPackages © 2026

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