Compare commits

..

No commits in common. "d37de8c61c94d1a0e1567e250804d4512c73dda4" and "f949d926dffe63a41419127baf1f924e693404d8" have entirely different histories.

3 changed files with 12 additions and 15 deletions

View File

@ -181,18 +181,7 @@ 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)) { dd($linkPath);
\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);
} }

View File

@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void public function up(): void
{ {
Schema::create('management', function (Blueprint $table) { Schema::create('management', function (Blueprint $table) {
$table->increments('management_id'); // 主キー、AUTO_INCREMENT, NOT NULL $table->id('management_id'); // 主キー、AUTO_INCREMENT, NOT NULL
$table->string('management_name', 255); // varchar(255), NOT NULL $table->string('management_name', 255); // varchar(255), NOT NULL
$table->string('management_code', 10)->unique(); // varchar(10), NOT NULL, UNIQUE $table->string('management_code', 10)->unique(); // varchar(10), NOT NULL, UNIQUE
$table->boolean('municipality_flag')->nullable(); // tinyint(1), NULL $table->boolean('municipality_flag')->nullable(); // tinyint(1), NULL

View File

@ -134,14 +134,22 @@
</div> </div>
</td> </td>
@php @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; $stamp_file = null;
if (!empty($inv_setting->company_image_path)) { if (!empty($inv_setting->company_image_path)) {
// company_image_path: storage/app/public/xxx.png → other-storage/xxx.png // 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); $stamp_file = str_replace('storage/app/public/', 'other-storage/', $inv_setting->company_image_path);
}
@endphp @endphp
@if($stamp_file) @if($stamp_file)
<td><img src="{{ asset($stamp_file) }}" class="stamp"></td> <td><img src="{{ str_replace('\\', '/', public_path('images/' . $stamp_file)) }}" class="stamp"></td>
@endif @endif
</tr> </tr>
</table> </table>