laraditz/google-sheets
最新稳定版本:1.0.0
Composer 安装命令:
composer require laraditz/google-sheets
包简介
Wrapper for Google Sheets API V4
README 文档
README
A simple wrapper for Google Sheets API V4.
Installation
You can install the package via composer:
composer require laraditz/google-sheets
Setup
- This api uses Authentication with Service Accounts. Follow the instructions to Create a Service Account.
- Download the JSON credentials.
- By default the path to the credentials is at storage
app/credentials.json. You can set your own path by overwrite the value throughGOOGLE_SHEETS_AUTH_CONFIGenv. - There are also other
.envvalue that you can overwrite to suites your need as below:-
GOOGLE_SHEETS_APP_NAME="Google Sheets"
GOOGLE_SHEETS_ACCESS_TYPE=offline
GOOGLE_SHEETS_AUTH_CONFIG="app/credentials.json"
Usage
$spreadsheetId = "XXxXXxXXXXXx_XXxXXxXXXXXx_XXxXXxXXXXXx"; // this will be your spreadsheet ID $range = "Sheet 1"; // here we use the name of the Sheet to get all the rows // read all the rows of given sheet, sheet will return a Collection and you may use any of Collection method such as all(), toArray(), etc $sheets = app('google-sheets')->spreadsheet($spreadsheetId)->sheet($range)->all();
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email raditzfarhan@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Package Dependencies
This package depends on https://github.com/googleapis/google-api-php-client
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-20