-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from infusionsoft/feature/frameworksupport
Add Initial Framework Support
- Loading branch information
Showing
5 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Infusionsoft/FrameworkSupport/Laravel/InfusionsoftFacade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php namespace Infusionsoft\FrameworkSupport\Laravel; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class InfusionsoftFacade extends Facade { | ||
protected static function getFacadeAccessor() { return 'infusionsoft'; } | ||
} |
52 changes: 52 additions & 0 deletions
52
src/Infusionsoft/FrameworkSupport/Laravel/InfusionsoftServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php namespace Infusionsoft\FrameworkSupport\Laravel; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Infusionsoft\Infusionsoft; | ||
|
||
class InfusionsoftServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$config = __DIR__ . '/config/config.php'; | ||
$this->mergeConfigFrom($config, 'infusionsoft'); | ||
$this->publishes([$config => config_path('infusionsoft.php')]); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('infusionsoft', function ($app) { | ||
|
||
return new Infusionsoft(config('infusionsoft')); | ||
|
||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return array('infusionsoft'); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/Infusionsoft/FrameworkSupport/Laravel/config/config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
return array( | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Your Infusionsoft OAuth2 Credentials | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
|
||
'client_id' => env('INFUSIONSOFT_CLIENT_ID'), | ||
|
||
'client_secret' => env('INFUSIONSOFT_SECRET'), | ||
|
||
'redirect_url' => env('INFUSIONSOFT_REDIRECT_URL'), | ||
|
||
); |
56 changes: 56 additions & 0 deletions
56
src/Infusionsoft/FrameworkSupport/Lumen/InfusionsoftServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php namespace Infusionsoft\FrameworkSupport\Lumen; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Infusionsoft\Infusionsoft; | ||
|
||
class InfusionsoftServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('infusionsoft', function ($app) { | ||
|
||
$config = [ | ||
'client_id' => env('INFUSIONSOFT_CLIENT_ID'), | ||
'client_secret' => env('INFUSIONSOFT_SECRET'), | ||
'redirect_url' => env('INFUSIONSOFT_REDIRECT_URL'), | ||
]; | ||
|
||
return new Infusionsoft($config); | ||
|
||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return array('infusionsoft'); | ||
} | ||
|
||
} |