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.
- Host: GitHub
- URL: https://github.com/laravel-studio/laravel-google-sheet-integration
- Owner: laravel-studio
- Created: 2020-01-14T06:53:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T18:00:50.000Z (almost 4 years ago)
- Last Synced: 2025-04-10T14:14:32.795Z (about 1 year ago)
- Topics: google-sheets-api, laravel, laravel-framework, laravel-package
- Language: PHP
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
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.**