From 452435df2658ca6885911afae937b5275ce82c22 Mon Sep 17 00:00:00 2001 From: Amir Date: Sun, 19 Mar 2023 14:53:55 +0800 Subject: [PATCH] Add new config storage_directory used for api --- .env.example | 3 +++ config/app.php | 2 ++ config/filesystems.php | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 7682d66b..027d4cc7 100644 --- a/.env.example +++ b/.env.example @@ -306,3 +306,6 @@ MARHUN_CAMERAS_FIREFOX = "jSsq68fCLg2guCV2FaFzvXXiKBqbPA25DaQAWWotfqY=" WABOT_API=https://md.wabot.my/api/send.php WABOT_INSTANCES_ID=63C26B7AAD21A WABOT_TOKEN_KEYS=cbee7e95cf3ffbfa0531d5fddfd44f87 + +# for config STORAGE_DIRECTORY, set value without slash at the end +# STORAGE_DIRECTORY=/Users/UTM/Sites/lelong/storage \ No newline at end of file diff --git a/config/app.php b/config/app.php index 4ed0c00f..a1933cd1 100644 --- a/config/app.php +++ b/config/app.php @@ -250,4 +250,6 @@ return [ 'api_url_kaunter' => env('API_URL_KAUNTER', 'http://localhost'), 'app_pembida' => env('APP_PEMBIDA', 'http://localhost:8080'), + + 'storage_directory' => env('STORAGE_DIRECTORY', storage_path()), ]; diff --git a/config/filesystems.php b/config/filesystems.php index c5de2c17..c93f918d 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -37,14 +37,14 @@ return [ 'marhun' => [ 'driver' => 'local', - 'root' => storage_path('app/marhun'), + 'root' => config('app.storage_directory').DIRECTORY_SEPARATOR.'app/marhun', 'url' => env('APP_URL').'/marhun_photo', 'visibility' => 'public', ], 'resit' => [ 'driver' => 'local', - 'root' => storage_path('app'.DIRECTORY_SEPARATOR.'resit'), + 'root' => config('app.storage_directory').DIRECTORY_SEPARATOR.'app/resit', 'url' => env('APP_URL').'/resit_photo', 'visibility' => 'public', ],