app/Http/Controllers/ReceiptController.php を更新
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 24s

This commit is contained in:
y.higashide 2026-01-21 17:48:38 +09:00
parent 29ce166b4d
commit 3d79e24ff5

View File

@ -181,6 +181,18 @@ class ReceiptController extends Controller
$krgmStoragePath = config('app.krgm_storage_path'); $krgmStoragePath = config('app.krgm_storage_path');
$linkPath = public_path('other-storage'); $linkPath = public_path('other-storage');
if (!file_exists($krgmStoragePath)) {
\Log::error('KRGM path not found: ' . $krgmStoragePath);
abort(404, '画像パスが見つかりません。');
}
if (!file_exists($linkPath)) {
$result = symlink($krgmStoragePath, $linkPath);
\Log::info('Symlink result: ' . ($result ? 'success' : 'failed'));
if (!$result) {
\Log::error('Symlink failed');
abort(500, 'リンク作成失敗');
}
}
if (!file_exists($linkPath)) { if (!file_exists($linkPath)) {
symlink($krgmStoragePath, $linkPath); symlink($krgmStoragePath, $linkPath);
} }