Skip to content

Commit

Permalink
Merge pull request #6 from kyranb/master
Browse files Browse the repository at this point in the history
Add facade loader and example to readme
  • Loading branch information
darkin1 authored Nov 6, 2016
2 parents de15cb0 + 58bd2a6 commit bb30aef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ And add the service provider in `config/app.php`:
Darkin1\Intercom\IntercomServiceProvider::class,
```

And add the facade alias in `config/app.php`:

```php
'Intercom' => Darkin1\Intercom\Facades\Intercom::class,
```

Configuration
-------------

Expand All @@ -36,6 +42,20 @@ return [
```


Example
-------------

```php

use Intercom;

$users = Intercom::users()->getUsers([]);

$leads = Intercom::leads()->getLeads([]);

```


Documentation
-------------

Expand Down
6 changes: 6 additions & 0 deletions src/IntercomServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Config;
use Intercom\IntercomClient;
use Darkin1\Intercom\Facades\Intercom;

class IntercomServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -46,6 +47,11 @@ public function register()

return new IntercomApi($intercom);
});

$this->app->booting(function () {
$loader = AliasLoader::getInstance();
$loader->alias('Intercom', Intercom::class);
});
}

/**
Expand Down

0 comments on commit bb30aef

Please sign in to comment.