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.
- 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
- PHP >= 7+
- Laravel 8+
- Google API Client Library
- 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.
- 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
The usage documentation can be found in the Usage.