diff --git a/app/Http/Controllers/Hse/EmployeeController.php b/app/Http/Controllers/Hse/EmployeeController.php index 3759a09..5579442 100644 --- a/app/Http/Controllers/Hse/EmployeeController.php +++ b/app/Http/Controllers/Hse/EmployeeController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Hse; use App\Http\Controllers\Controller; use App\Models\Employee; use App\Models\User; +use App\Services\ImageCompressionService; use App\Services\SimperPdfExporter; use App\Services\SimpleXlsxExporter; use App\Services\SimpleXlsxImporter; @@ -536,6 +537,7 @@ class EmployeeController extends Controller 'position' => ['required', 'string'], 'is_operator' => ['required', 'in:1,0'], 'simper_expired_at' => ['nullable', 'date'], + 'photo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp', 'max:10240'], ], [ 'nik.required' => 'NIK wajib diisi.', 'nik.unique' => 'NIK sudah terdaftar dalam sistem.', @@ -563,6 +565,11 @@ class EmployeeController extends Controller $user->assignRole('employee'); } + $photoPath = null; + if ($request->hasFile('photo')) { + $photoPath = ImageCompressionService::uploadAndCompress($request->file('photo'), 'employees', 500, 500, 80); + } + Employee::create([ 'nik' => $validated['nik'], 'name' => $validated['name'], @@ -571,6 +578,7 @@ class EmployeeController extends Controller 'position' => $validated['position'], 'is_operator' => $isOperator, 'simper_expired_at' => $simperExpiredAt, + 'photo_path' => $photoPath, 'user_id' => $user->id, ]); @@ -592,6 +600,7 @@ class EmployeeController extends Controller 'position' => ['sometimes', 'required', 'string'], 'is_operator' => ['required', 'in:1,0'], 'simper_expired_at' => ['nullable', 'date'], + 'photo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp', 'max:10240'], ], [ 'nik.unique' => 'NIK sudah digunakan oleh karyawan lain.', 'name.required' => 'Nama lengkap wajib diisi.', @@ -601,6 +610,12 @@ class EmployeeController extends Controller $isOperator = (bool) $validated['is_operator']; $simperExpiredAt = $isOperator ? ($validated['simper_expired_at'] ?? $employee->simper_expired_at) : null; + $photoPath = $employee->photo_path; + if ($request->hasFile('photo')) { + ImageCompressionService::deleteIfExists($employee->photo_path); + $photoPath = ImageCompressionService::uploadAndCompress($request->file('photo'), 'employees', 500, 500, 80); + } + $employee->update([ 'nik' => $validated['nik'] ?? $employee->nik, 'name' => $validated['name'] ?? $employee->name, @@ -609,6 +624,7 @@ class EmployeeController extends Controller 'position' => $validated['position'] ?? $employee->position, 'is_operator' => $isOperator, 'simper_expired_at' => $simperExpiredAt, + 'photo_path' => $photoPath, ]); return back()->with('success', "Data SIMPER untuk {$employee->name} berhasil diperbarui."); diff --git a/app/Http/Controllers/Qma/VehicleController.php b/app/Http/Controllers/Qma/VehicleController.php index 09b8cfe..129a720 100644 --- a/app/Http/Controllers/Qma/VehicleController.php +++ b/app/Http/Controllers/Qma/VehicleController.php @@ -9,6 +9,7 @@ use App\Models\P2hRecord; use App\Models\P2hTemplate; use App\Models\Vehicle; use App\Models\VehicleActivity; +use App\Services\ImageCompressionService; use App\Services\SimpleXlsxExporter; use App\Services\VehiclePdfExporter; use Carbon\Carbon; @@ -895,6 +896,7 @@ class VehicleController extends Controller 'kir_document' => ['nullable', 'string', 'max:150'], 'ownership' => ['nullable', 'string', 'max:150'], 'division' => ['nullable', 'string', 'max:100'], + 'photo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp', 'max:10240'], ]); return DB::transaction(function () use ($request, $category) { @@ -918,6 +920,11 @@ class VehicleController extends Controller return back()->withInput()->with('error', "Kode unit [{$code}] sudah terdaftar di sistem. Silakan gunakan nomor urut lain."); } + $photoPath = null; + if ($request->hasFile('photo')) { + $photoPath = ImageCompressionService::uploadAndCompress($request->file('photo'), 'vehicles', 800, 800, 75); + } + $unit = Vehicle::create([ 'code' => $code, 'category' => 'unit_support', @@ -939,6 +946,7 @@ class VehicleController extends Controller 'fuel_consumption' => $category->fuel_consumption, 'silo_document' => $request->input('silo_document'), 'kir_document' => $request->input('kir_document'), + 'photo_path' => $photoPath, ]); return back()->with('success', "Unit fisik [{$unit->code}] berhasil ditambahkan ke kategori {$category->unit_category}."); @@ -962,6 +970,7 @@ class VehicleController extends Controller 'division' => ['nullable', 'string', 'max:100'], 'status' => [$category === 'unit_support' ? 'nullable' : 'required', 'string', 'in:Operation,Standby,Breakdown,Maintenance'], 'current_km' => [$category === 'unit_support' ? 'nullable' : 'required', 'numeric', 'min:0'], + 'photo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp', 'max:10240'], ]; // Atribut opsional spesifik Unit Support (Kendaraan Berat) @@ -994,6 +1003,11 @@ class VehicleController extends Controller $validated['current_km'] = $validated['current_km'] ?? 0; } + if ($request->hasFile('photo')) { + $validated['photo_path'] = ImageCompressionService::uploadAndCompress($request->file('photo'), 'vehicles', 800, 800, 75); + } + unset($validated['photo']); + $vehicle = Vehicle::create($validated); if ($vehicle->isSupportCategory()) { @@ -1045,6 +1059,7 @@ class VehicleController extends Controller 'stnk_document' => ['nullable', 'string', 'max:150'], 'pajak_document' => ['nullable', 'string', 'max:150'], 'kir_document' => ['nullable', 'string', 'max:150'], + 'photo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp', 'max:10240'], ]; $validated = $request->validate($rules, [ @@ -1054,6 +1069,12 @@ class VehicleController extends Controller 'current_km.required' => 'Nilai KM / HM wajib diisi.', ]); + if ($request->hasFile('photo')) { + ImageCompressionService::deleteIfExists($vehicle->photo_path); + $validated['photo_path'] = ImageCompressionService::uploadAndCompress($request->file('photo'), 'vehicles', 800, 800, 75); + } + unset($validated['photo']); + DB::transaction(function () use ($vehicle, $validated, $oldCode, $newCode) { $vehicle->update($validated); @@ -1133,6 +1154,13 @@ class VehicleController extends Controller } } + if ($vehicle->isSupportCategory()) { + foreach ($vehicle->units as $u) { + ImageCompressionService::deleteIfExists($u->photo_path); + } + } + ImageCompressionService::deleteIfExists($vehicle->photo_path); + $code = $vehicle->code; $vehicle->delete(); diff --git a/app/Models/Employee.php b/app/Models/Employee.php index cadf280..5f02434 100644 --- a/app/Models/Employee.php +++ b/app/Models/Employee.php @@ -30,6 +30,10 @@ class Employee extends Model 'simper_expired_at' => 'date', ]; + protected $appends = [ + 'photo_url', + ]; + /** * Cek apakah SIMPER masih aktif hari ini. */ @@ -42,6 +46,19 @@ class Employee extends Model return $this->simper_expired_at->isFuture() || $this->simper_expired_at->isToday(); } + public function getPhotoUrlAttribute(): ?string + { + if (!$this->photo_path) { + return null; + } + + if (str_starts_with($this->photo_path, 'http://') || str_starts_with($this->photo_path, 'https://')) { + return $this->photo_path; + } + + return asset('storage/' . ltrim($this->photo_path, '/')); + } + /** * Scope untuk mengambil hanya karyawan yang berstatus operator/driver. */ diff --git a/app/Models/Vehicle.php b/app/Models/Vehicle.php index 04bfae8..49ca044 100644 --- a/app/Models/Vehicle.php +++ b/app/Models/Vehicle.php @@ -46,11 +46,28 @@ class Vehicle extends Model 'parent_id' => 'integer', ]; + protected $appends = [ + 'photo_url', + ]; + public function isLightVehicle(): bool { return $this->category === 'light_vehicle'; } + public function getPhotoUrlAttribute(): ?string + { + if (!$this->photo_path) { + return null; + } + + if (str_starts_with($this->photo_path, 'http://') || str_starts_with($this->photo_path, 'https://')) { + return $this->photo_path; + } + + return asset('storage/' . ltrim($this->photo_path, '/')); + } + public function isUnitSupport(): bool { return $this->category === 'unit_support'; diff --git a/app/Services/ImageCompressionService.php b/app/Services/ImageCompressionService.php new file mode 100644 index 0000000..6d6c3b0 --- /dev/null +++ b/app/Services/ImageCompressionService.php @@ -0,0 +1,150 @@ +guessExtension() ?: 'jpg'); + return $file->storeAs($cleanDir, $fallbackName, 'public'); + } + + try { + $realPath = $file->getRealPath(); + $imageContent = file_get_contents($realPath); + if ($imageContent === false) { + $fallbackName = Str::random(40) . '.' . ($file->guessExtension() ?: 'jpg'); + return $file->storeAs($cleanDir, $fallbackName, 'public'); + } + + // Buat resource gambar dari data string + $srcImage = @imagecreatefromstring($imageContent); + if (!$srcImage) { + $fallbackName = Str::random(40) . '.' . ($file->guessExtension() ?: 'jpg'); + return $file->storeAs($cleanDir, $fallbackName, 'public'); + } + + // 1. Tangani Auto-Orientation berdasarkan EXIF (kamera smartphone) + if (function_exists('exif_read_data')) { + $exif = @exif_read_data($realPath); + if (!empty($exif['Orientation'])) { + $srcImage = match ($exif['Orientation']) { + 3 => imagerotate($srcImage, 180, 0), + 6 => imagerotate($srcImage, -90, 0), + 8 => imagerotate($srcImage, 90, 0), + default => $srcImage, + }; + } + } + + // 2. Hitung Dimensi Proporsional + $origWidth = imagesx($srcImage); + $origHeight = imagesy($srcImage); + + if ($origWidth > $maxWidth || $origHeight > $maxHeight) { + $ratio = min($maxWidth / $origWidth, $maxHeight / $origHeight); + $targetWidth = max(1, (int) round($origWidth * $ratio)); + $targetHeight = max(1, (int) round($origHeight * $ratio)); + } else { + $targetWidth = $origWidth; + $targetHeight = $origHeight; + } + + // 3. Buat Canvas Truecolor Baru + $canvas = imagecreatetruecolor($targetWidth, $targetHeight); + + // Beri latar belakang putih solid jika ada area transparan (PNG/WebP) + $white = imagecolorallocate($canvas, 255, 255, 255); + imagefilledrectangle($canvas, 0, 0, $targetWidth, $targetHeight, $white); + + // 4. Salin & Resample Gambar dengan Kualitas Tinggi + imagecopyresampled( + $canvas, + $srcImage, + 0, + 0, + 0, + 0, + $targetWidth, + $targetHeight, + $origWidth, + $origHeight + ); + + // 5. Simpan Hasil Kompresi Gambar ke Buffer Memori sesuai format yang didukung + $compressedStream = null; + $extension = 'jpg'; + + if (function_exists('imagejpeg')) { + $extension = 'jpg'; + ob_start(); + imagejpeg($canvas, null, $quality); + $compressedStream = ob_get_clean(); + } elseif (function_exists('imagewebp')) { + $extension = 'webp'; + ob_start(); + imagewebp($canvas, null, $quality); + $compressedStream = ob_get_clean(); + } elseif (function_exists('imagepng')) { + $extension = 'png'; + $pngLevel = max(0, min(9, (int) round((100 - $quality) / 10))); + ob_start(); + imagepng($canvas, null, $pngLevel); + $compressedStream = ob_get_clean(); + } + + // Bersihkan resource GD dari memori + imagedestroy($canvas); + imagedestroy($srcImage); + + if (!empty($compressedStream)) { + $fileName = Str::random(40) . '.' . $extension; + $targetPath = $cleanDir . '/' . $fileName; + Storage::disk('public')->put($targetPath, $compressedStream); + return $targetPath; + } + } catch (\Throwable $e) { + // Jika terjadi kesalahan proses GD, fallback aman simpan file asli + } + + $fallbackName = Str::random(40) . '.' . ($file->guessExtension() ?: 'jpg'); + return $file->storeAs($cleanDir, $fallbackName, 'public'); + } + + /** + * Hapus file foto lama dari disk publik jika ada. + * + * @param string|null $path + * @return void + */ + public static function deleteIfExists(?string $path): void + { + if (!empty($path) && Storage::disk('public')->exists($path)) { + Storage::disk('public')->delete($path); + } + } +} diff --git a/resources/views/hse/employees_index.blade.php b/resources/views/hse/employees_index.blade.php index 162bd91..6bbaabe 100644 --- a/resources/views/hse/employees_index.blade.php +++ b/resources/views/hse/employees_index.blade.php @@ -151,8 +151,19 @@ {{ $emp->nik }} - - {{ $emp->name }} + + +
+ @if($emp->photo_path) + {{ $emp->name }} + @else +
+ {{ substr($emp->name, 0, 1) }} +
+ @endif + {{ $emp->name }} +
+ {{ $emp->position ?? '-' }} @@ -273,8 +284,27 @@ -
+ @csrf + +
+ +
+
+ + +
+
+ +

Format: JPG, PNG, WebP (Maks. 10MB). Resolusi & file dikompresi otomatis.

+
+
+
@@ -485,9 +515,28 @@
- + @csrf +
+ +
+
+ + +
+
+ +

Pilih foto baru jika ingin mengganti. Otomatis dikompresi hemat storage.

+
+
+
+
@@ -680,6 +729,24 @@ } } + function previewEmployeeImage(input, imgId, placeholderId) { + if (input.files && input.files[0]) { + const reader = new FileReader(); + reader.onload = function(e) { + const img = document.getElementById(imgId); + const placeholder = document.getElementById(placeholderId); + if (img) { + img.src = e.target.result; + img.classList.remove('hidden'); + } + if (placeholder) { + placeholder.classList.add('hidden'); + } + }; + reader.readAsDataURL(input.files[0]); + } + } + function openEditModal(emp) { document.getElementById('editNikDisplay').textContent = emp.nik || '-'; document.getElementById('editNameDisplay').textContent = emp.name || '-'; @@ -687,6 +754,24 @@ document.getElementById('editDivisionPositionDisplay').textContent = (emp.division || '-') + ' / ' + (emp.position || '-'); document.getElementById('editOperator').value = emp.is_operator ? '1' : '0'; + const editPhotoPreview = document.getElementById('editEmpPhotoPreview'); + const editPhotoPlaceholder = document.getElementById('editEmpPhotoPlaceholder'); + const editPhotoInput = document.getElementById('editEmpPhotoInput'); + if (editPhotoInput) editPhotoInput.value = ''; + if (emp.photo_url) { + if (editPhotoPreview) { + editPhotoPreview.src = emp.photo_url; + editPhotoPreview.classList.remove('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.add('hidden'); + } else { + if (editPhotoPreview) { + editPhotoPreview.src = ''; + editPhotoPreview.classList.add('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.remove('hidden'); + } + let expDate = ''; if (emp.simper_expired_at) { expDate = emp.simper_expired_at.substring(0, 10); @@ -829,6 +914,17 @@ // Modal Tambah Karyawan Manual function openAddKaryawanModal() { const modal = document.getElementById('addKaryawanModal'); + const addPhotoPreview = document.getElementById('addEmpPhotoPreview'); + const addPhotoPlaceholder = document.getElementById('addEmpPhotoPlaceholder'); + const addPhotoInput = document.getElementById('addEmpPhotoInput'); + if (addPhotoInput) addPhotoInput.value = ''; + if (addPhotoPreview) { + addPhotoPreview.src = ''; + addPhotoPreview.classList.add('hidden'); + } + if (addPhotoPlaceholder) { + addPhotoPlaceholder.classList.remove('hidden'); + } if (modal) modal.classList.remove('hidden'); } function closeAddKaryawanModal() { diff --git a/resources/views/qma/vehicles_lv.blade.php b/resources/views/qma/vehicles_lv.blade.php index 544226e..9ec89bf 100644 --- a/resources/views/qma/vehicles_lv.blade.php +++ b/resources/views/qma/vehicles_lv.blade.php @@ -145,7 +145,21 @@ - {{ $v->brand_type }} +
+ @if($v->photo_path) + {{ $v->code }} + @else +
+ +
+ @endif +
+
{{ $v->brand_type }}
+ @if($v->serial_number) +
SN: {{ $v->serial_number }}
+ @endif +
+
@@ -267,10 +281,29 @@
- + @csrf +
+ +
+
+ + +
+
+ +

Format: JPG, PNG, WebP (Maks. 10MB). Otomatis dikompresi agar hemat storage.

+
+
+
+
@@ -364,10 +397,29 @@
- + @csrf +
+ +
+
+ + +
+
+ +

Pilih foto baru jika ingin mengganti. Otomatis dikompresi hemat storage server.

+
+
+
+
@@ -456,6 +508,11 @@
+ + +
@@ -828,8 +885,37 @@ }); } + function previewVehicleImage(input, imgId, placeholderId) { + if (input.files && input.files[0]) { + const reader = new FileReader(); + reader.onload = function(e) { + const img = document.getElementById(imgId); + const placeholder = document.getElementById(placeholderId); + if (img) { + img.src = e.target.result; + img.classList.remove('hidden'); + } + if (placeholder) { + placeholder.classList.add('hidden'); + } + }; + reader.readAsDataURL(input.files[0]); + } + } + function openAddModal() { document.getElementById('addVehicleModal').classList.remove('hidden'); + const addPhotoPreview = document.getElementById('addPhotoPreview'); + const addPhotoPlaceholder = document.getElementById('addPhotoPlaceholder'); + const addPhotoInput = document.getElementById('addPhotoInput'); + if (addPhotoInput) addPhotoInput.value = ''; + if (addPhotoPreview) { + addPhotoPreview.src = ''; + addPhotoPreview.classList.add('hidden'); + } + if (addPhotoPlaceholder) { + addPhotoPlaceholder.classList.remove('hidden'); + } if (addCodeInput) addCodeInput.focus(); } function closeAddModal() { @@ -849,6 +935,24 @@ document.getElementById('editOwnership').value = v.ownership || ''; document.getElementById('editStatus').value = v.status || 'Operation'; document.getElementById('editCurrentKm').value = v.current_km || 0; + + const editPhotoPreview = document.getElementById('editPhotoPreview'); + const editPhotoPlaceholder = document.getElementById('editPhotoPlaceholder'); + const editPhotoInput = document.getElementById('editPhotoInput'); + if (editPhotoInput) editPhotoInput.value = ''; + if (v.photo_url) { + if (editPhotoPreview) { + editPhotoPreview.src = v.photo_url; + editPhotoPreview.classList.remove('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.add('hidden'); + } else { + if (editPhotoPreview) { + editPhotoPreview.src = ''; + editPhotoPreview.classList.add('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.remove('hidden'); + } } function closeEditModal() { document.getElementById('editVehicleModal').classList.add('hidden'); @@ -865,6 +969,16 @@ document.getElementById('detailDivision').innerText = v.division || '-'; document.getElementById('detailOwnership').innerText = v.ownership || '-'; + const detailPhotoContainer = document.getElementById('detailPhotoContainer'); + const detailPhoto = document.getElementById('detailPhoto'); + if (v.photo_url) { + if (detailPhoto) detailPhoto.src = v.photo_url; + if (detailPhotoContainer) detailPhotoContainer.classList.remove('hidden'); + } else { + if (detailPhoto) detailPhoto.src = ''; + if (detailPhotoContainer) detailPhotoContainer.classList.add('hidden'); + } + const badge = document.getElementById('detailStatusBadge'); if (badge) { badge.className = 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-bold border '; diff --git a/resources/views/qma/vehicles_support.blade.php b/resources/views/qma/vehicles_support.blade.php index e1d0b35..5065d69 100644 --- a/resources/views/qma/vehicles_support.blade.php +++ b/resources/views/qma/vehicles_support.blade.php @@ -130,7 +130,18 @@ - {{ $v->unit_category ?? 'Alat Berat' }} +
+ @if($v->photo_path) + {{ $v->code }} + @else +
+ +
+ @endif +
+ {{ $v->unit_category ?? 'Alat Berat' }} +
+
@@ -240,10 +251,29 @@
- + @csrf +
+ +
+
+ + +
+
+ +

Format: JPG, PNG, WebP (Maks. 10MB). Resolusi & file dikompresi otomatis.

+
+
+
+
@@ -343,10 +373,29 @@
- + @csrf +
+ +
+
+ + +
+
+ +

Pilih foto baru jika ingin mengganti. Otomatis dikompresi hemat storage.

+
+
+
+
@@ -443,6 +492,11 @@
+ + +
@@ -794,8 +848,37 @@ }); } + function previewVehicleImage(input, imgId, placeholderId) { + if (input.files && input.files[0]) { + const reader = new FileReader(); + reader.onload = function(e) { + const img = document.getElementById(imgId); + const placeholder = document.getElementById(placeholderId); + if (img) { + img.src = e.target.result; + img.classList.remove('hidden'); + } + if (placeholder) { + placeholder.classList.add('hidden'); + } + }; + reader.readAsDataURL(input.files[0]); + } + } + function openAddModal() { document.getElementById('addVehicleModal').classList.remove('hidden'); + const addPhotoPreview = document.getElementById('addPhotoPreview'); + const addPhotoPlaceholder = document.getElementById('addPhotoPlaceholder'); + const addPhotoInput = document.getElementById('addPhotoInput'); + if (addPhotoInput) addPhotoInput.value = ''; + if (addPhotoPreview) { + addPhotoPreview.src = ''; + addPhotoPreview.classList.add('hidden'); + } + if (addPhotoPlaceholder) { + addPhotoPlaceholder.classList.remove('hidden'); + } if (addCodeInput) addCodeInput.focus(); } function closeAddModal() { @@ -836,6 +919,24 @@ } document.getElementById('editOwnership').value = v.ownership || ''; document.getElementById('editFuelConsumption').value = v.fuel_consumption || ''; + + const editPhotoPreview = document.getElementById('editPhotoPreview'); + const editPhotoPlaceholder = document.getElementById('editPhotoPlaceholder'); + const editPhotoInput = document.getElementById('editPhotoInput'); + if (editPhotoInput) editPhotoInput.value = ''; + if (v.photo_url) { + if (editPhotoPreview) { + editPhotoPreview.src = v.photo_url; + editPhotoPreview.classList.remove('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.add('hidden'); + } else { + if (editPhotoPreview) { + editPhotoPreview.src = ''; + editPhotoPreview.classList.add('hidden'); + } + if (editPhotoPlaceholder) editPhotoPlaceholder.classList.remove('hidden'); + } } function closeEditModal() { document.getElementById('editVehicleModal').classList.add('hidden'); @@ -853,6 +954,16 @@ document.getElementById('detailDivision').innerText = v.division || '-'; document.getElementById('detailOwnership').innerText = v.ownership || 'PT Kerinci Merangin Hidro'; + const detailPhotoContainer = document.getElementById('detailPhotoContainer'); + const detailPhoto = document.getElementById('detailPhoto'); + if (v.photo_url) { + if (detailPhoto) detailPhoto.src = v.photo_url; + if (detailPhotoContainer) detailPhotoContainer.classList.remove('hidden'); + } else { + if (detailPhoto) detailPhoto.src = ''; + if (detailPhotoContainer) detailPhotoContainer.classList.add('hidden'); + } + const count = v.units_count !== undefined ? v.units_count : 0; document.getElementById('detailUnitCountText').innerText = count + ' Unit Fisik'; const manageBtn = document.getElementById('detailManageUnitsBtn'); diff --git a/resources/views/qma/vehicles_support_units.blade.php b/resources/views/qma/vehicles_support_units.blade.php index a1234eb..329e58c 100644 --- a/resources/views/qma/vehicles_support_units.blade.php +++ b/resources/views/qma/vehicles_support_units.blade.php @@ -154,9 +154,18 @@ - - {{ $u->code }} - +
+ @if($u->photo_path) + {{ $u->code }} + @else +
+ +
+ @endif + + {{ $u->code }} + +
@@ -331,9 +340,28 @@ Tambah Unit Baru - + @csrf +
+ +
+
+ + +
+
+ +

Format: JPG, PNG, WebP (Maks. 10MB). Resolusi otomatis dikompresi hemat storage.

+
+
+
+