Skip to content

Commit

Permalink
Correct bindings for laravel/lumen 5.5+
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Kasymov committed Jul 30, 2018
1 parent e1344be commit eb1df0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
}
],
"require": {
"php": ">=5.5.9",
"illuminate/support": "5.*"
"php": ">=7.0",
"illuminate/support": ">=5.5"
},
"autoload": {
"psr-4": {
Expand Down
17 changes: 7 additions & 10 deletions src/TransmitsmsApiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ class TransmitsmsApiServiceProvider extends ServiceProvider {
public function boot()
{
$this->publishes([
__DIR__.'/config/config.php' => config_path('transmitsmsapi.php'),
__DIR__.'/config/config.php' => app()->basePath() . '/config/transmitsmsapi.php',
], 'config');

$this->app['Abreeden\TransmitSmsApi\TransmitSmsApi'] = function ($app) {
return $app['transmitsmsapi'];
};

}

/**
Expand All @@ -39,12 +34,14 @@ public function register()
{
$this->mergeConfigFrom(__DIR__.'/config/config.php', 'transmitsmsapi');

$this->app['transmitsmsapi'] = $this->app->share(function($app)
{
$config = $app['config']->get('transmitsmsapi');
$this->app->singleton('transmitsmsapi', function ($app) {
$config = $app['config']->get('transmitsmsapi');

return new TransmitsmsApi($config['api_key'], $config['secret']);
});
});

$this->app->bind('Abreeden\TransmitsmsApi\TransmitsmsApi', function ($app) {
return $app->make('transmitsmsapi');
});
}
}

0 comments on commit eb1df0b

Please sign in to comment.