diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ce78741..255a081 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -45,10 +45,13 @@ class Controller extends BaseController protected function setCustomeDirectoryUpload($company_name) { - $pathImage = 'assets/' . $company_name . '/image/'; - $pathDocument = 'assets/' . $company_name . '/file/project/'; - $pathTmpImport = 'assets/' . $company_name . '/file/tmpimport/'; - $pathActivityDocument = 'assets/' . $company_name . '/file/activity/'; + $current_date = date('Y-m-d'); + [$year, $month, $day] = explode('-', $current_date); + + $pathImage = 'assets/' . $company_name . ' ' . $year . '-' . $month . '-' . $day . '/image/'; + $pathDocument = 'assets/' . $company_name . ' ' . $year . '-' . $month . '-' . $day . '/file/project/'; + $pathTmpImport = 'assets/' . $company_name . ' ' . $year . '-' . $month . '-' . $day . '/file/tmpimport/'; + $pathActivityDocument = 'assets/' . $company_name . ' ' . $year . '-' . $month . '-' . $day . '/file/activity/'; return [ 'pathImage' => $pathImage,