Skip to content

Commit

Permalink
Allow Laravel version >= 6
Browse files Browse the repository at this point in the history
  • Loading branch information
TZK- committed Sep 15, 2020
1 parent 02ba9fe commit 22749bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.*|5.*",
"illuminate/support": ">=4",
"mailin-api/mailin-api-php": "dev-master"
},
"autoload": {
Expand Down
18 changes: 2 additions & 16 deletions src/Vansteen/Sendinblue/SendinblueServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function boot()
{
$this->package('vansteen/sendinblue');
}
elseif ($version[0] == 5)
elseif ($version[0] >= 5)
{
$this->publishes([
__DIR__.'/../../config/config.php' => config_path('sendinblue.php'),
Expand All @@ -43,21 +43,7 @@ public function boot()
public function register()
{
$this->app->singleton('sendinblue_wrapper', function() {

$app = app();
$version = $app::VERSION;

if ($version[0] == 4)
{
$ml = new Mailin('https://api.sendinblue.com/v2.0', Config::get('sendinblue::apikey'));
return new SendinblueWrapper($ml);
}
elseif ($version[0] == 5)
{
$ml = new Mailin('https://api.sendinblue.com/v2.0', Config::get('sendinblue.apikey'));
return new SendinblueWrapper($ml);
}

return new SendinblueWrapper(new Mailin('https://api.sendinblue.com/v2.0', Config::get('sendinblue::apikey')));
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Vansteen/Sendinblue/SendinblueWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function __call($method, array $args)
// Otherwise, treat it as a property
return $this->ml->{$method};
}
}
}
2 changes: 1 addition & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
|
*/

'apikey' => 'your-api-key',
'apikey' => env('SENDINBLUE_API_KEY'),

);

0 comments on commit 22749bc

Please sign in to comment.