Host images locally
We don’t need the complexity of S3. Sepcifically the complexity of managing my own AWS account, flysystem made the Laravel side easy. A command is added to copy the the S3 files over to local storage.
This commit is contained in:
parent
d80e8164c8
commit
d7da42b626
47 changed files with 295 additions and 214 deletions
|
@ -62,7 +62,7 @@ class BookmarkService extends Service
|
|||
$response = $client->request('GET', 'https://web.archive.org/save/' . $url);
|
||||
} catch (ClientException $e) {
|
||||
//throw an exception to be caught
|
||||
throw new InternetArchiveException();
|
||||
throw new InternetArchiveException;
|
||||
}
|
||||
if ($response->hasHeader('Content-Location')) {
|
||||
if (Str::startsWith(Arr::get($response->getHeader('Content-Location'), 0), '/web')) {
|
||||
|
@ -71,6 +71,6 @@ class BookmarkService extends Service
|
|||
}
|
||||
|
||||
//throw an exception to be caught
|
||||
throw new InternetArchiveException();
|
||||
throw new InternetArchiveException;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class UpdateService
|
|||
if ($property === 'photo') {
|
||||
foreach ($value as $photoURL) {
|
||||
if (Str::startsWith($photoURL, 'https://')) {
|
||||
$media = new Media();
|
||||
$media = new Media;
|
||||
$media->path = $photoURL;
|
||||
$media->type = 'image';
|
||||
$media->save();
|
||||
|
|
|
@ -25,7 +25,7 @@ class PlaceService
|
|||
$data['latitude'] = $matches[0][0];
|
||||
$data['longitude'] = $matches[0][1];
|
||||
}
|
||||
$place = new Place();
|
||||
$place = new Place;
|
||||
$place->name = $data['name'];
|
||||
$place->description = $data['description'];
|
||||
$place->latitude = $data['latitude'];
|
||||
|
@ -53,7 +53,7 @@ class PlaceService
|
|||
if (Arr::has($checkin, 'properties.latitude') === false) {
|
||||
throw new \InvalidArgumentException('Missing required longitude/latitude');
|
||||
}
|
||||
$place = new Place();
|
||||
$place = new Place;
|
||||
$place->name = Arr::get($checkin, 'properties.name.0');
|
||||
$place->external_urls = Arr::get($checkin, 'properties.url.0');
|
||||
$place->latitude = Arr::get($checkin, 'properties.latitude.0');
|
||||
|
|
|
@ -19,7 +19,7 @@ class TokenService
|
|||
$config = resolve(Configuration::class);
|
||||
|
||||
$token = $config->builder()
|
||||
->issuedAt(new DateTimeImmutable())
|
||||
->issuedAt(new DateTimeImmutable)
|
||||
->withClaim('client_id', $data['client_id'])
|
||||
->withClaim('me', $data['me'])
|
||||
->withClaim('scope', $data['scope'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue