AWS SDK with Lumen

- 1 answer

Ad

I'm trying to install AWS Laravel SDK with lumen. I could install it with:

{
"require": {
    "aws/aws-sdk-php-laravel": "~3.0"
    }
}

But then, documentation says:

Find the providers key in your config/app.php and register the AWS Service Provider.

'providers' => array(
    // ...
    Aws\Laravel\AwsServiceProvider::class,
)

Find the aliases key in your config/app.php and add the AWS facade alias.

'aliases' => array(
    // ...
    'AWS' => Aws\Laravel\AwsFacade::class,
)

Thing is in Lumen, there is no config/app.php

How can I do it???

Ad

Answer

Ad

In bootstrap/app.php, add following:

Provider:

$app->register(Aws\Laravel\AwsServiceProvider::class);

Facade

class_alias('Aws\Laravel\AwsFacade','AWS');

  • Please note that you have to uncomment $app->withFacades(); in order to work the facade.
Ad
source: stackoverflow.com
Ad