public function __construct()
{
$key = $this->config('key');
$region = $this->config('region');
if (empty($key)) {
throw new \RuntimeException('AmazonS3 key config required.');
}
$secret = $this->config('secret');
if (empty($secret)) {
throw new \RuntimeException('AmazonS3 secret config required.');
}
$bucket = $this->config('bucket');
if (empty($bucket)) {
throw new \RuntimeException('AmazonS3 bucket config required.');
}
$this->bucket = $bucket;
$this->client = S3Client::factory(array('key' => $key, 'secret' => $secret, 'region' => $region));
}