redaelfillali/google-sheet-integration

Laravel package for Google Sheet integration

v1.0.4 2024-07-03 08:15 UTC

This package is auto-updated.

Last update: 2024-09-03 08:42:24 UTC


README

A Laravel 10 package to integrate Google Sheets, allowing you to link a model to a Google Sheet, update the Google Sheet, and add new rows for each new value of the selected model. Customize the mapping of Google Sheet columns to model values.

Latest Stable Version Stars Php Google API client Total Downloads License

Features

  • Link a Laravel model to a Google Sheet
  • Update Google Sheets with model data
  • Add new rows to Google Sheets when new model values are added
  • Customize the column mapping between the Google Sheet and model attributes

Requirements

  • PHP >= 7+
  • Laravel 8+
  • Google API Client Library

Installation

Prerequisites

  1. Ensure you have Composer installed.
  2. Set up a Google Cloud project with the Sheets API enabled and create a service account with JSON credentials. Follow this guide to set up the Google Sheets API and create a service account.

Step-by-Step Guide

  1. Install the package via Composer:
composer require redaelfillali/google-sheet-integration
  1. Publish the package configuration file:
php artisan vendor:publish --provider="RedaElfillali\\GoogleSheetIntegration\\GoogleSheetServiceProvider" --tag=config
  1. Add the following environment variables to your .env file:
GOOGLE_SHEET_CREDENTIALS_PATH=/path/to/credentials.json

Usage

The usage documentation can be found in the Usage.