Skip to content

Commit 3b276a6

Browse files
add s3 public (#193)
1 parent 50ee81a commit 3b276a6

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

app/Filament/Resources/NewsResource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public static function form(Form $form): Form
7474
SpatieMediaLibraryFileUpload::make('cover_photo')
7575
->collection('cover_photos')
7676
->enableOpen()
77+
->disk('s3-public')
7778
->maxFiles(1)
7879
->conversion('thumb')
7980
->visibility('public')
@@ -92,6 +93,7 @@ public static function form(Form $form): Form
9293
SpatieMediaLibraryFileUpload::make('media_files')
9394
->collection('media_files')
9495
->enableOpen()
96+
->disk('s3-public')
9597
->panelLayout('grid')
9698
->multiple()
9799
->conversion('thumb')

app/Filament/Resources/ResourceResource.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ function (callable $get, callable $set) {
9191
->required(),
9292
]),
9393

94-
// The logic that toggles the visibility of the field groups
95-
// is included in the abstract FieldGroup class.
94+
9695
FieldGroups\AircraftFieldGroup::make(),
9796
FieldGroups\BoatFieldGroup::make(),
9897
FieldGroups\BroadcastFieldGroup::make(),

config/filesystems.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@
5757
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
5858
'throw' => false,
5959
],
60+
's3-public' => [
61+
'driver' => 's3',
62+
'key' => env('AWS_ACCESS_KEY_ID'),
63+
'secret' => env('AWS_SECRET_ACCESS_KEY'),
64+
'region' => env('AWS_DEFAULT_REGION'),
65+
'bucket' => env('AWS_BUCKET_PUBLIC'),
66+
'url' => env('AWS_URL'),
67+
'endpoint' => env('AWS_ENDPOINT'),
68+
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
69+
'throw' => false,
70+
],
6071

6172
],
6273

0 commit comments

Comments
 (0)