kayac / sheet
Google sheet with laravel
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-11-10 01:34:16 UTC
README
Lấy dữ liệu từ google sheet
Installation
-
Run
composer require kayac/sheet:1.6.x@dev
-
Add service provider into config/app.php file.
Kayac\Sheet\CallRouteServiceProvider::class
-
Run composer update
-
publish kayacsheet.php to config folder
php artisan vendor:publish --provider="Kayac\Sheet\CallRouteServiceProvider" --tag=config
Commands
Tạo controller bất kỳ và
<?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();
}
}
Chạy lệnh sau để tạo file credentials với google
php artisan route:call --uri=/master-data
##Author Hà Anh Mận
##Document Xem thêm cách dùng Google Sheet ở đây https://developers.google.com/sheets/api/quickstart/php