<?php
namespace App\Providers;
use Aws\S3\S3Client;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(){
Schema::defaultStringLength(191);
}
/**
* Register any application services.
*
* @return void
*/
public function register()
$this->app->singleton(S3Client::class, function() {
$s3 = new S3Client([
'region' => 'eu-west-1',
'version' => 'latest',
'credentials' => [
'key' => getenv("S3_ACCESS_KEY"),
'secret' => getenv("S3_SECRET")
]
]);
return $s3;
});