Skip to content

Commit 6643e8e

Browse files
Fixed lumen support
1 parent 47d805e commit 6643e8e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/AwsServiceProvider.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php namespace Aws\Laravel;
22

33
use Aws\Sdk;
4+
use Illuminate\Foundation\Application as LaravelApplication;
45
use Illuminate\Support\ServiceProvider;
6+
use Laravel\Lumen\Application as LumenApplication;
57

68
/**
79
* AWS SDK for PHP service provider for Laravel applications
@@ -26,8 +28,10 @@ public function boot()
2628
{
2729
$source = realpath(__DIR__ . '/../config/aws.php');
2830

29-
if (class_exists('Illuminate\Foundation\Application', false)) {
31+
if ($this->app instanceof LaravelApplication && $app->runningInConsole()) {
3032
$this->publishes([$source => config_path('aws.php')]);
33+
} elseif ($this->app instanceof LumenApplication) {
34+
$app->configure('aws');
3135
}
3236

3337
$this->mergeConfigFrom($source, 'aws');
@@ -41,7 +45,8 @@ public function boot()
4145
public function register()
4246
{
4347
$this->app->singleton('aws', function ($app) {
44-
$config = $app['config']->get('aws');
48+
$config = $app->make('config')->get('aws');
49+
4550
return new Sdk($config);
4651
});
4752

0 commit comments

Comments
 (0)