升级到 Laravel 5.1 AWS SDK 无效

Upgrading to Laravel 5.1 AWS SDK not working

我用以下行更新了 composer.json:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "illuminate/html": "5.0.*@dev",
    "aws/aws-sdk-php": "~3.0"

运行 作曲家更新,然后更新我的 config/app.php 文件:

'providers' => [
    Aws\Laravel\AwsServiceProvider::class,

'aliases' => [
    'AWS'       => Aws\Laravel\AwsFacade::class,

我正在尝试像这样调用 AWS S3 存储桶(在 L4.2 中工作):

$s3 = App::make('aws')->get('s3');

我收到此错误:

FatalErrorException in ProviderRepository.php line 146:
Class 'Aws\Laravel\AwsServiceProvider' not found

您需要为 Laravel 安装 SDK 包。它将安装 AWS 库作为其依赖项之一:

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

在这里查看官方文档:https://github.com/aws/aws-sdk-php-laravel