Skip to content

Commit 35c8889

Browse files
committed
Fix public disk to use s3 in serverless
1 parent 4c5eb45 commit 35c8889

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,6 @@
297297
'multitenancy' => env('MULTITENANCY', false),
298298

299299
'resources_core_path' => base_path('resources-core'),
300+
301+
'serverless' => env('SERVERLESS', false),
300302
];

config/filesystems.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,24 @@
5656
'root' => env('PROCESS_TEMPLATES_PATH') ? base_path(env('PROCESS_TEMPLATES_PATH')) : database_path('processes/templates'),
5757
],
5858

59-
'public' => [ // used throught the system
60-
'driver' => 'local',
61-
'root' => storage_path('app/public'),
62-
'url' => env('APP_URL') . '/storage',
63-
'visibility' => 'public',
64-
'throw' => false,
65-
],
59+
'public' => config('app.serverless') ?
60+
[
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_PUBLIC_BUCKET'),
66+
'url' => env('AWS_URL'),
67+
'visibility' => 'public',
68+
'throw' => false,
69+
] :
70+
[ // used through the system
71+
'driver' => 'local',
72+
'root' => storage_path('app/public'),
73+
'url' => env('APP_URL') . '/storage',
74+
'visibility' => 'public',
75+
'throw' => false,
76+
],
6677

6778
's3' => [ // DownloadSecurityLog
6879
'driver' => 's3',

0 commit comments

Comments
 (0)