From f949d926dffe63a41419127baf1f924e693404d8 Mon Sep 17 00:00:00 2001 From: Yuka Higashide Date: Wed, 21 Jan 2026 17:22:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B7=E3=83=B3=E3=83=9C=E3=83=AA=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++++ app/Http/Controllers/ReceiptController.php | 8 ++++++++ config/app.php | 2 ++ resources/views/receipt/pdf.blade.php | 20 ++++++++++++-------- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 6495c6c..bf433ec 100644 --- a/.env +++ b/.env @@ -97,3 +97,7 @@ GOOGLE_CLOUD_PROJECT_ID=midyear-acre-471109-e5 # Google Maps API Configuration (距離計算用) GOOGLE_MAPS_API_KEY=AIzaSyBz0aqzyBXfZwwmXc4EpJDHqcfnmSv3_2g +# ----------------------------------------------- +# 社員側参照用 +KRGM_STORAGE_PATH=/var/www/krgm/current/storage/app/public + diff --git a/app/Http/Controllers/ReceiptController.php b/app/Http/Controllers/ReceiptController.php index 4ed15c2..4205812 100644 --- a/app/Http/Controllers/ReceiptController.php +++ b/app/Http/Controllers/ReceiptController.php @@ -179,6 +179,14 @@ class ReceiptController extends Controller ->where('management_id', $management_id) ->first(); + $krgmStoragePath = config('app.krgm_storage_path'); + $linkPath = public_path('other-storage'); + dd($linkPath); + if (!file_exists($linkPath)) { + symlink($krgmStoragePath, $linkPath); + } + + // ダウンロード回数をカウントアップ DB::table('inv_publish') ->where('contract_id', $contract_id) diff --git a/config/app.php b/config/app.php index 182fbeb..0767204 100644 --- a/config/app.php +++ b/config/app.php @@ -123,4 +123,6 @@ return [ 'store' => env('APP_MAINTENANCE_STORE', 'database'), ], + 'krgm_storage_path' => env('KRGM_STORAGE_PATH'), + ]; diff --git a/resources/views/receipt/pdf.blade.php b/resources/views/receipt/pdf.blade.php index 960fda3..263af50 100644 --- a/resources/views/receipt/pdf.blade.php +++ b/resources/views/receipt/pdf.blade.php @@ -134,15 +134,19 @@ @php + // $stamp_file = null; + // $extensions = ['png', 'jpeg', 'jpg']; + // foreach ($extensions as $ext) { + // $file_path = public_path('images/' . $inv_setting->t_name . '_stamp.' . $ext); + // if (file_exists($file_path)) { + // $stamp_file = $inv_setting->t_name . '_stamp.' . $ext; + // break; + // } + // } $stamp_file = null; - $extensions = ['png', 'jpeg', 'jpg']; - foreach ($extensions as $ext) { - $file_path = public_path('images/' . $inv_setting->t_name . '_stamp.' . $ext); - if (file_exists($file_path)) { - $stamp_file = $inv_setting->t_name . '_stamp.' . $ext; - break; - } - } + if (!empty($inv_setting->company_image_path)) { + // company_image_path: storage/app/public/xxx.png → other-storage/xxx.png + $stamp_file = str_replace('storage/app/public/', 'other-storage/', $inv_setting->company_image_path); @endphp @if($stamp_file)