An open API service indexing awesome lists of open source software.

https://github.com/laravel-studio/laravel-google-sheet-integration

Integrate your application data in google sheet.
https://github.com/laravel-studio/laravel-google-sheet-integration

google-sheets-api laravel laravel-framework laravel-package

Last synced: 11 months ago
JSON representation

Integrate your application data in google sheet.

Awesome Lists containing this project

README

          

# laravel-google-sheet-integration
# Installation:
1. `composer require laravel-studio/laravel-google-sheet-integration`

2. Add this code under providers array

`laravelstudio\laravelgooglesheetintegration\GoogleSheetServiceProvider::class,`

Add this under aliases array of config > app.php

`'GoogleSheet' => laravelstudio\laravelgooglesheetintegration\facades\googlesheet::class`

3. You have to add this in $routeMiddleware in Kernal.php

`'googleAuth' => \laravelstudio\laravelgooglesheetintegration\middleware\googleAuth::class,`

`'checkUserAuth' => \laravelstudio\laravelgooglesheetintegration\middleware\checkUserAuth::class,`

4. Set GOOGLE_SHEET_RETURN_URL key value in .env file like :

`GOOGLE_SHEET_RETURN_URL=http://localhost:8000/`

5. Run `composer dump-autoload`
6. Run `php artisan vendor:publish`
7. Run `php artisan migrate`

## Use:
Your google auth config file will be under config > googlesheet.php. Place your auth credentials here.

Packages views will be under resources > views > vendor > googlesheet, make your customization here.

------------

**Note: if you are not going to use package’s layout page, then make sure this scripts are included at your main layout or copy from package’s layout page.**

**Css File:**

``

``

``

**Js file:**

``

``

``

After including those scripts include @stack('google-drive-scripts')
and @stack('auto-auth-script') at end of the script.

------------

**Show google sheet auth button **
To add google auth button use this in your controller file (make sure that you have looged in user of your application)
` return view('laravelgooglesheetintegration::signin');`

**Save or update google sheet data:**
use this facade in controller `use GoogleSheet;`
then use this code:
`GoogleSheet::updatesettings($data);`

**Here is the sample data format:**

```json
$data = '{
"sheet_name":"Test Google Sheet",
"data": {
"Itobuz1": [{
"Accuracy": "30",
"Latitude": "53.2778273",
"Longitude": "-9.0121648",
"Timestamp": "Fri Jun 28 2013 11:43:57 GMT+0100 (IST)"
}, {
"Accuracy": "30",
"Latitude": "53.2778273",
"Longitude": "-9.0121648",
"Timestamp": "Fri Jun 28 2013 11:43:57 GMT+0100 (IST)",
"Location": "Kolkata"
}],
"Itobuz2": [{
"Accuracy": "30",
"Latitude": "53.2778273",
"Longitude": "-9.0121648",
"Timestamp": "Fri Jun 28 2013 11:43:57 GMT+0100 (IST)",
"Code": "47852"
}, {
"Accuracy": "30",
"Latitude": "53.2778273",
"Longitude": "-9.0121648"
}]
}
}';
```
**Note: if u choose folder then it creates new sheet or if you choose existing file then it will be updated.**