PHPackages                             upwebdesign/grovo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. upwebdesign/grovo

ActiveLibrary[API Development](/categories/api)

upwebdesign/grovo
=================

Grovo API Service Provider for Laravel 5

4.2.x-dev(10y ago)1471MITPHPPHP &gt;=5.4.0

Since Oct 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/upwebdesign/grovo)[ Packagist](https://packagist.org/packages/upwebdesign/grovo)[ RSS](/packages/upwebdesign-grovo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Grovo
=====

[](#grovo)

Laravel 5.1 Grovo API Service Provider

Grovo API Documentation

### Required setup

[](#required-setup)

In the `repositories` key of `composer.json` file add the following

```
"require": {
  "php": ">=5.5.9",
  "laravel/framework": "5.1.*",
  ...
  "upwebdesign/grovo": "dev-master",
},
...
"repositories": [ {
  "type": "vcs",
  "url": "https://github.com/upwebdesign/grovo"
}],
```

Run the Composer update comand

```
$ composer update

```

or

```
$ composer update upwebdesign/grovo

```

In your `config/app.php` add `'Upwebdesign\Grovo\GrovoServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Upwebdesign\Grovo\GrovoServiceProvider',

),
```

Don't forget to dump composer autoload

```
$ composer dump-autoload

```

### Configuration

[](#configuration)

In `config/filesystems.php`, add new disk

```
'config' => [
    'driver' => 'local',
    'root' => config_path()
],
```

Publish the grovo.config file

```
$ php artisan vendor:publish

```

In order to make requests to Grovo, we need to obtain an API Token. You can do so by running:

```
$ php artisan grovo:requestToken

```

When this command finishes, it will update your `config/grovo.config` file with the new token. It is recommended to store your token in your `.env`. Example:

```
APP_ENV=local
APP_DEBUG=true
...
GROVO_TOKEN=xxxxxxxx
```

In your `config/grovo.php` config file, update

```
  'client_id' => '',
  'client_secret' => '',
  ...
  'token' => env(GROVO_TOKEN),
```

Now, access to your Grovo Token is securely stored in your `.env` file.

Usage
-----

[](#usage)

So, we have our Grovo API Token and are ready to start making requests.

In case of an error a exception, `HttpException`, will be thrown and can be caught.

```
use Upwebdesign\Grovo\Grovo
```

Type-hint

```
public function method(Grovo $grovo)
```

Get User

```
$grovo->user()->get($id);
```

Creat User

```
$grovo->user()->create([
  'email': 'jimmys@grovo.com',
  'first_name': 'Jon',
  'last_name': 'Sales',
  'groups': [
    'Engineering',
    'Platform',
    'API'
  ],
  'office_location': 'New York',
  'department': 'Engineering',
  'job_title': 'Senior Engineer',
  'employee_id': 8,
  'employment_type': 'fulltime',
  'hire_date': '2014-11-17 22:36:59',
  'status': 'active'
]);
```

Update User

```
$grovo->user()->update($id, [
  'first_name': 'Feddy',
  'groups': 'Architecture'
]);
```

Delete User

```
$grovo->user()->delete($id);
```

A full example

```
