kayac / sheet
使用 Laravel 的 Google Sheet
1.2
2018-07-24 22:17 UTC
Requires
- php: >=5.5.9
- google/apiclient: ^2.0
This package is not auto-updated.
Last update: 2024-09-29 01:03:50 UTC
README
从 Google Sheet 获取数据
安装
-
运行
composer require kayac/sheet:1.6.x@dev
-
将服务提供者添加到 config/app.php 文件。
Kayac\Sheet\CallRouteServiceProvider::class
-
运行 composer update
-
将 kayacsheet.php 发布到配置文件夹
php artisan vendor:publish --provider="Kayac\Sheet\CallRouteServiceProvider" --tag=config
命令
创建任何控制器并
<?php
namespace App\Http\Controllers;
use Illuminate\Routing\Router;
use Kayac\Sheet\SheetReader;
class MasterDataController extends MyController
{
function __construct(Router $router)
{
parent::__construct($router);
}
public function index() {
$sheet = new SheetReader();
$sheet->generateKey();
}
}
运行以下命令以创建与 Google 的 credentials 文件
php artisan route:call --uri=/master-data
## 作者: Hà Anh Mận
## 文档:更多关于如何使用 Google Sheet 的方法,请参阅此处 https://developers.google.com/sheets/api/quickstart/php