rhincodon / laravel-eloquent-spreadsheets
同步 Eloquent 模型与 Google 表格
0.1.5
2017-04-11 11:31 UTC
Requires
- php: ^7.0
- google/apiclient: ^2.1
- google/apiclient-services: ^0.11.0
- illuminate/bus: ~5.3.0|~5.4.0
- illuminate/console: ~5.3.0|~5.4.0
- illuminate/contracts: ~5.3.0|~5.4.0
- illuminate/queue: ~5.3.0|~5.4.0
- illuminate/support: ~5.3.0|~5.4.0
This package is not auto-updated.
Last update: 2024-09-28 20:09:13 UTC
README
快速预览
安装
通过 Composer
$ composer require rhincodon/laravel-eloquent-spreadsheets
在 config/app.php
中注册服务提供者
Rhinodontypicus\EloquentSpreadsheets\EloquentSpreadsheetsServiceProvider::class,
发布配置
php artisan vendor:publish --provider="Rhinodontypicus\EloquentSpreadsheets\EloquentSpreadsheetsServiceProvider" --tag="config"
获取 Google 凭据
在 Google 控制台中创建服务帐户
步骤 1
步骤 2
点击创建后,会提供凭据文件,您可以在项目中使用。只需将其保存在存储中的某个位置。
您还需要为该服务帐户授权使用将使用的表格。只需复制凭据文件中的 client_email
,然后使用它来授权。
用法
要开始使用包,您需要在配置文件中指定要同步到配置文件中的模型数组。这是一个自解释的配置。
目前,它正在从应用程序到表格添加、更新、删除操作,以及从表格到应用程序的更新操作。所有操作都在队列中处理。
如果您想从表格同步(仅更新操作起作用)数据回应用程序,请安排以下命令
$schedule->command('eloquent-spreadsheets:sync')->hourly();
路线图
- 测试
致谢
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。