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.
Download revolution/laravel-google-sheets
More information about revolution/laravel-google-sheets
Files in revolution/laravel-google-sheets
Informations about the package laravel-google-sheets
Google Sheets API v4 for Laravel
Requirements
- PHP >= 8.2
- Laravel >= 11.0
Versioning
- Basic : semver
- Drop old PHP or Laravel version :
+0.1
. composer should handle it well. - Support only latest major version (
master
branch), but you can PR to old branches.
Installation
Composer
Laravel
-
Run
php artisan vendor:publish --tag="google-config"
to publish the google config file// config/google.php // OAuth 'client_id' => env('GOOGLE_CLIENT_ID', ''), 'client_secret' => env('GOOGLE_CLIENT_SECRET', ''), 'redirect_uri' => env('GOOGLE_REDIRECT', ''), 'scopes' => [\Google\Service\Sheets::DRIVE, \Google\Service\Sheets::SPREADSHEETS], 'access_type' => 'online', 'approval_prompt' => 'auto', 'prompt' => 'consent', //"none", "consent", "select_account" default:none // or Service Account 'file' => storage_path('credentials.json'), 'enable' => env('GOOGLE_SERVICE_ENABLED', true),
-
Get API Credentials from https://developers.google.com/console
EnableGoogle Sheets API
,Google Drive API
. -
Configure .env as needed
GOOGLE_APPLICATION_NAME= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT= GOOGLE_DEVELOPER_KEY= GOOGLE_SERVICE_ENABLED= GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION=
Demo
Another Google API Series.
- https://github.com/kawax/laravel-google-photos
- https://github.com/kawax/laravel-google-searchconsole
Select auth type
You must select an authentication type and configure it appropriately.
- Service Account : Access to only your own spreadsheets.
- OAuth : Access to user's spreadsheets.
- API key: Access to public spreadsheets.
Usage
id | name | |
---|---|---|
1 | name1 | mail1 |
2 | name2 | mail2 |
https://docs.google.com/spreadsheets/d/{spreadsheetID}/...
Basic Laravel Usage
Basic Non-Laravel Usage
Get a sheet's values with the header as the key
Blade
Using A1 Notation
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
LICENSE
MIT
Copyright kawax
All versions of laravel-google-sheets with dependencies
illuminate/container Version ^11.0
illuminate/support Version ^11.0
google/apiclient Version ^2.16