### Run Composer Update (Shell) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Executes the Composer update command from the project root to download and install the packages specified in composer.json, including the AWS Service Provider. ```sh php composer.phar update ``` -------------------------------- ### Initialize AWS S3 Client via app() helper (Lumen PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Illustrates the method for retrieving the AWS SDK instance from the service container specifically within a Lumen application using the global app() helper function. This is the standard way to access services in Lumen. ```php $s3 = app('aws')->createClient('s3'); $s3->putObject(array( 'Bucket' => 'YOUR_BUCKET', 'Key' => 'YOUR_OBJECT_KEY', 'SourceFile' => '/the/path/to/the/file/you/are/uploading.ext', )); ``` -------------------------------- ### Initialize AWS S3 Client via Facade (Laravel PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Shows how to access the AWS SDK using the registered AWS facade, providing a more concise syntax compared to using App::make. This requires the AWS facade to be configured in the application's aliases. ```php $s3 = AWS::createClient('s3'); $s3->putObject(array( 'Bucket' => 'YOUR_BUCKET', 'Key' => 'YOUR_OBJECT_KEY', 'SourceFile' => '/the/path/to/the/file/you/are/uploading.ext', )); ``` -------------------------------- ### Initialize AWS S3 Client via App::make (Laravel PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Demonstrates how to retrieve the AWS SDK instance from the Laravel Service Container using the App::make method and create an S3 client to upload a file. This method is standard for accessing bound services. ```php $s3 = App::make('aws')->createClient('s3'); $s3->putObject(array( 'Bucket' => 'YOUR_BUCKET', 'Key' => 'YOUR_OBJECT_KEY', 'SourceFile' => '/the/path/to/the/file/you/are/uploading.ext', )); ``` -------------------------------- ### Publish AWS Service Provider Configuration (Shell) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Uses the Artisan command-line tool to publish the default configuration file for the AWS Service Provider into the application's config directory, allowing customization. ```sh php artisan vendor:publish --provider="Aws\Laravel\AwsServiceProvider" ``` -------------------------------- ### Default AWS Service Provider Configuration (PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Shows the default structure and settings for the published AWS Service Provider configuration file (config/aws.php), including options for credentials, region, version, and service-specific overrides. ```php return [ 'credentials' => [ 'key' => env('AWS_ACCESS_KEY_ID', ''), 'secret' => env('AWS_SECRET_ACCESS_KEY', ''), ], 'region' => env('AWS_REGION', 'us-east-1'), 'version' => 'latest', // You can override settings for specific services 'Ses' => [ 'region' => 'us-east-1', ], ]; ``` -------------------------------- ### Require AWS Service Provider in composer.json (JSON) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Adds the AWS Service Provider package as a dependency in the project's composer.json file, specifying the required version range for compatibility. ```json { "require": { "aws/aws-sdk-php-laravel": "~3.0" } } ``` -------------------------------- ### Register AWS Service Provider in Lumen (PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Registers the AWS Service Provider class within the Lumen application's bootstrap file (bootstrap/app.php) to make its services available. ```php $app->register(Aws\Laravel\AwsServiceProvider::class); ``` -------------------------------- ### Register AWS Service Provider in Laravel (PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Adds the AWS Service Provider class to the list of registered providers in the Laravel application's configuration file (config/app.php). ```php 'providers' => array( // ... Aws\Laravel\AwsServiceProvider::class, ) ``` -------------------------------- ### Add AWS Facade Alias in Laravel (PHP) Source: https://github.com/aws/aws-sdk-php-laravel/blob/master/README.md Defines a convenient alias 'AWS' for the AWS Service Provider's facade class in the Laravel application's configuration (config/app.php), allowing easier access to AWS services. ```php 'aliases' => array( // ... 'AWS' => Aws\Laravel\AwsFacade::class, ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.