Download the PHP package revolution/laravel-google-sheets without Composer

On this page you can find all versions of the php package revolution/laravel-google-sheets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-google-sheets

Google Sheets API v4 for Laravel

packagist Maintainability Code Coverage Ask DeepWiki

Overview

This package provides a Laravel-idiomatic and streamlined interface for interacting with Google Sheets API v4. It abstracts away the underlying Google PHP client complexity, letting developers read, write, update, and manage spreadsheets with expressive, fluent methods that feel natural in Laravel applications.

Key Features:

Common Use Cases:

Concept

The main purpose of this package is reading from Google Sheets. Instead of specifying detailed conditions before reading, it is assumed that you first retrieve all data as a Laravel Collection and then process the data on the Laravel side.

Requirements

Installation

Composer

Laravel Configuration

  1. Run php artisan vendor:publish --tag="google-config" to publish the google config file

  2. Enable Google APIs in Google Cloud Console:

    • Google Sheets API
    • Google Drive API
  3. Choose your authentication method and configure accordingly (see Authentication section below)

Demo & Examples

Related Google API Packages:

Authentication

You must choose an authentication method based on your use case. This package supports three authentication methods:

Scopes setting is required in config/google.php for both OAuth and Service Account authentication. Example:

Authentication Methods Comparison

Method Use Case User Interaction Access Scope Complexity
Service Account Server-to-server, automated systems None required Specific spreadsheets you own/share Medium
OAuth 2.0 User-facing applications User consent required User's own spreadsheets High
API Key Public data only None required Public spreadsheets only Low

Service Account (Recommended for most applications)

Best for: Background jobs, automated systems, server-to-server access

Access spreadsheets that your application owns or has been granted access to. No user interaction required.

📖 Complete Service Account Setup Guide →

OAuth 2.0

Best for: Applications where users access their own Google Sheets

Users grant permission to access their personal Google Sheets. Requires user consent flow.

📖 Complete OAuth Setup Guide →

API Key (Public Access Only)

Best for: Accessing publicly shared, read-only spreadsheets

Limited to reading data from spreadsheets that are publicly accessible. No authentication flow required.

To use API Key authentication:

  1. Get an API Key from Google Cloud Console
  2. Ensure your spreadsheet is publicly accessible (shared with "Anyone with the link")
  3. Use the key in your application:

⚠️ API Key Limitations:

Quick Start

Here's how to get started quickly with each authentication method:

Using Service Account (Recommended)

  1. Setup: Follow the Service Account Setup Guide
  2. Configure: Add to your .env file:

  3. Share: Share your Google Sheet with the service account email
  4. Use: Start reading/writing data:

Using OAuth 2.0

  1. Setup: Follow the OAuth Setup Guide
  2. Configure: Add OAuth credentials to your .env file
  3. Authenticate: Handle user authentication flow
  4. Use: Access user's spreadsheets:

Using API Key (Public Access)

  1. Setup: Get API key from Google Cloud Console
  2. Configure: Add to your .env file:

  3. Use: Read public spreadsheets:

Usage

Consider this example spreadsheet structure:

id name mail
1 name1 mail1
2 name2 mail2

Spreadsheet URL: https://docs.google.com/spreadsheets/d/{spreadsheetID}/...

Service Account Usage

When using Service Account authentication, no token setup is required:

OAuth Usage

When using OAuth authentication, you need to set the user's access token:

Get a sheet's values with the header as the key (Recommended)

Collection conversion is simple and subsequent processing is flexible, so this method is recommended.

Blade

Using A1 Notation

About A1 Notation

A1 Notation is the standard way to specify a cell or range in Google Sheets (e.g., 'A1', 'A1:B2').

If you are not familiar with A1 Notation or your range is dynamic/complicated, it is often easier to fetch all data and use Laravel Collections to process/filter it after retrieval.

Updating a specific range

Append a set of values to a sheet

Append a set of values with keys

Add a new sheet

Deleting a sheet

Specifying query parameters

https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get#query-parameters

Use original Google\Service\Sheets

see https://github.com/google/google-api-php-client-services/blob/master/src/Google/Service/Sheets.php

FAQ

Which authentication method should I use?

How do I share a spreadsheet with my Service Account?

  1. Open your Google Sheet
  2. Click the "Share" button
  3. Find the client_email in your service account JSON file
  4. Share the spreadsheet with this email address
  5. Grant "Editor" permissions for read/write access

Can I access multiple spreadsheets?

Yes! You can access any spreadsheet that:

How do I handle authentication errors?

Common solutions:

How do I deploy this to production?

LICENSE

MIT License


All versions of laravel-google-sheets with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0||^12.0
google/apiclient Version ^2.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package revolution/laravel-google-sheets contains the following files

Loading the files please wait ....