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
|
@ -27,7 +27,7 @@ class ContactsTableSeeder extends Seeder
|
|||
'homepage' => 'https://aaronparecki.com',
|
||||
'facebook' => '123456',
|
||||
]);
|
||||
$fs = new FileSystem();
|
||||
$fs = new FileSystem;
|
||||
if (! $fs->exists(public_path('assets/profile-images/aaronparecki.com'))) {
|
||||
$fs->makeDirectory(public_path('assets/profile-images/aaronparecki.com'));
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class LikesTableSeeder extends Seeder
|
|||
Like::factory(10)->create();
|
||||
|
||||
$now = Carbon::now()->subDays(rand(3, 6));
|
||||
$faker = new Generator();
|
||||
$faker = new Generator;
|
||||
$faker->addProvider(new \Faker\Provider\en_US\Person($faker));
|
||||
$faker->addProvider(new \Faker\Provider\Lorem($faker));
|
||||
$faker->addProvider(new \Faker\Provider\Internet($faker));
|
||||
|
|
|
@ -154,7 +154,7 @@ class NotesTableSeeder extends Seeder
|
|||
->update(['updated_at' => $now->toDateTimeString()]);
|
||||
|
||||
$now = Carbon::now()->subHours(5);
|
||||
$noteJustCheckin = new Note();
|
||||
$noteJustCheckin = new Note;
|
||||
$noteJustCheckin->setCreatedAt($now);
|
||||
$place = Place::find(1);
|
||||
$noteJustCheckin->place()->associate($place);
|
||||
|
@ -164,12 +164,12 @@ class NotesTableSeeder extends Seeder
|
|||
->update(['updated_at' => $now->toDateTimeString()]);
|
||||
|
||||
$now = Carbon::now()->subHours(4);
|
||||
$media = new Media();
|
||||
$media = new Media;
|
||||
$media->path = 'media/f1bc8faa-1a8f-45b8-a9b1-57282fa73f87.jpg';
|
||||
$media->type = 'image';
|
||||
$media->image_widths = '3648';
|
||||
$media->save();
|
||||
$noteWithOnlyImage = new Note();
|
||||
$noteWithOnlyImage = new Note;
|
||||
$noteWithOnlyImage->setCreatedAt($now);
|
||||
$noteWithOnlyImage->setUpdatedAt($now);
|
||||
$noteWithOnlyImage->save();
|
||||
|
|
|
@ -14,7 +14,7 @@ class PlacesTableSeeder extends Seeder
|
|||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$place = new Place();
|
||||
$place = new Place;
|
||||
$place->name = 'The Bridgewater Pub';
|
||||
$place->description = 'A lovely local pub with a decent selection of cask ales';
|
||||
$place->latitude = 53.4983;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue