elsevar/google-sheets

A Laravel package for Google Sheets integration

Maintainers

Package info

github.com/Rizayev/google_sheets_integration

pkg:composer/elsevar/google-sheets

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.2 2025-12-04 13:14 UTC

This package is auto-updated.

Last update: 2026-03-04 13:52:10 UTC


README

This is a Laravel package to integrate with Google Sheets API.

Installation

  1. Add the package to your composer.json (or install via composer if published).
  2. Run migrations:
    php artisan migrate
  3. Publish configuration:
    php artisan vendor:publish --tag=google-sheets-config

Configuration

Add your Google API credentials to .env:

GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=https://your-domain.com/google-sheets/callback

Usage

Authentication

Redirect users to the connection route: https://your-domain.com/google-sheets/connect

Service Usage

use Elsevar\GoogleSheets\Services\GoogleSheetsService;
use Elsevar\GoogleSheets\Models\GoogleToken;

$service = new GoogleSheetsService();
$token = GoogleToken::where('user_id', auth()->id())->first();

if ($token) {
    $service->setToken($token);
    
    // Read data
    $data = $service->readSheet('spreadsheet-id', 'Sheet1!A1:B10');
    
    // Write data
    $service->writeSheet('spreadsheet-id', 'Sheet1!A1', [['Name', 'Email']]);
}