Skip to content

Commit

Permalink
Merge branch 'release/0.1.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhincodon committed Nov 26, 2016
2 parents de168eb + 5a520fb commit ebd3a56
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
49 changes: 46 additions & 3 deletions README.md
Expand Up @@ -4,15 +4,58 @@
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![StyleCI](https://styleci.io/repos/74288997/shield)](https://styleci.io/repos/74288997)

Under development
Fast Preview:
![Preview](https://cloud.githubusercontent.com/assets/6630959/20640355/ca3f0676-b3ec-11e6-9d61-229092be3c09.gif "Preview")

## Installation

Coming Soon
Via Composer:

``` bash
$ composer require rhincodon/laravel-eloquent-spreadsheets
```

Register Service Provider in `config/app.php`:

```php
Rhinodontypicus\EloquentSpreadsheets\EloquentSpreadsheetsServiceProvider::class,
```

Publish config:

```bash
php artisan vendor:publish --provider="Rhinodontypicus\EloquentSpreadsheets\EloquentSpreadsheetsServiceProvider" --tag="config"
```

### Fetch Google Credentials

In Google Console create Service Account:

Step 1:
![Step 1](https://cloud.githubusercontent.com/assets/6630959/20640446/1ad7ab2c-b3ef-11e6-8320-5c2d521c88f2.jpg)

Step 2:
![Step 2](https://cloud.githubusercontent.com/assets/6630959/20640447/1ad94fc2-b3ef-11e6-93fe-bac58580d77f.jpg)

After pressing Create it will give you credentials file, which you can use in your project. Just save it somewhere in storage.

You also need to give access to spreadsheets that will be used to that service Account. Just copy `client_email` from credentials file, and use it to give access.

## Usage

Coming Soon
To start use package you need to specify array of models that will be synced in config file. It is a self-explainable config.

For now is working add, update, delete actions from app to spreadsheet. And update action from spreadsheet to app. All actions processed in queue.

If you want sync(only update action work) data back to app from spreadsheet, schedule following command:

```php
$schedule->command('eloquent-spreadsheets:sync')->hourly();
```

## Roadmap

- [ ] Tests

## Credits

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -4,7 +4,8 @@
"keywords": [
"laravel",
"eloquent",
"spreadsheets"
"spreadsheets",
"google"
],
"homepage": "https://github.com/Rhincodon/laravel-eloquent-spreadsheets",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions config/laravel-eloquent-spreadsheets.php
Expand Up @@ -3,6 +3,7 @@
return [
'credentials_path' => storage_path('credentials.json'),
'sync_models' => [
/*
\App\User::class => [
'spreadsheet_id' => '17GOsXgEe6WdPJ-aCO46bNb9T6me96LTEasv-E61-AxI',
'list_name' => 'Main',
Expand All @@ -13,5 +14,6 @@
],
'queue_name' => 'default',
],
*/
],
];

0 comments on commit ebd3a56

Please sign in to comment.