Storing and retrieving cloud content from Amazon S3
Using a service such as Amazon's S3 to store our files will allow us to leverage their servers' speed and reliability. To utilize the service, we can easily implement a Laravel package to handle our uploads to Amazon.
Getting ready
For this recipe, we'll need a working Laravel 4 installation. We'll also need a free Amazon AWS account, which can be registered at: http://aws.amazon.com/s3/
After registering, we need to get our Access Key ID and Secret ID from the Security Credentials page. Also, in the S3 management console, we'll need to have at least one bucket created. For this recipe, we'll call the bucket named as laravelcookbook
.
How to do it…
To complete this recipe, follow the given steps:
Open Laravel's
composer.json
file and add the Amazon SDK package. The require section should resemble the following snippet:"require": { "laravel/framework": "4.0.*", "aws/aws-sdk-php-laravel": "dev-master" },
Open the command line window, and install...