Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/AwsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php namespace Aws\Laravel;

use Aws\Sdk;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;

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

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

$this->mergeConfigFrom($source, 'aws');
Expand All @@ -41,7 +45,8 @@ public function boot()
public function register()
{
$this->app->singleton('aws', function ($app) {
$config = $app['config']->get('aws');
$config = $app->make('config')->get('aws');

return new Sdk($config);
});

Expand Down