redaelfillali / google-sheet-integration
Laravel package for Google Sheet integration
v1.0.4
2024-07-03 08:15 UTC
Requires
- php: ^7.3|^8.0
- google/apiclient: ^2.0
Requires (Dev)
- phpunit/phpunit: ^11.2
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.
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
- Ensure you have Composer installed.
- 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
- Install the package via Composer:
composer require redaelfillali/google-sheet-integration
- Publish the package configuration file:
php artisan vendor:publish --provider="RedaElfillali\\GoogleSheetIntegration\\GoogleSheetServiceProvider" --tag=config
- 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.