refactor: improve activity log table layout, remove column numbers, and modernize filter ui

This commit is contained in:
Wahyudin
2026-10-13 08:55:10 +07:00
parent 21ce908199
commit 7886621732
3 changed files with 242 additions and 102 deletions
@@ -36,6 +36,21 @@ class ActivityLogController extends Controller
$query->where('direction', $request->input('direction')); $query->where('direction', $request->input('direction'));
} }
// Filter Kata Kunci Pencarian (Kode LV, Tipe Kendaraan, Plat, Driver, Keperluan)
if ($request->filled('search')) {
$search = $request->input('search');
$query->where(function ($q) use ($search) {
$q->whereHas('vehicle', function ($vq) use ($search) {
$vq->where('code', 'like', "%{$search}%")
->orWhere('brand_type', 'like', "%{$search}%")
->orWhere('license_plate', 'like', "%{$search}%");
})->orWhereHas('driver', function ($dq) use ($search) {
$dq->where('name', 'like', "%{$search}%")
->orWhere('nik', 'like', "%{$search}%");
})->orWhere('purpose', 'like', "%{$search}%");
});
}
// Filter Status Validasi (pending, approved, rejected) // Filter Status Validasi (pending, approved, rejected)
if ($request->filled('status')) { if ($request->filled('status')) {
$query->where('validation_status', $request->input('status')); $query->where('validation_status', $request->input('status'));
+216 -91
View File
@@ -1,20 +1,20 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', 'Log Aktivitas Kendaraan QMA - 10 Kolom') @section('title', 'Log Aktivitas Kendaraan QMA')
@section('content') @section('content')
<div class="space-y-6"> <div class="space-y-6">
<!-- Header Judul & Total Catatan (Persis Format Standar Manajemen Sistem) --> <!-- Header Judul & Total Catatan -->
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4"> <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
<div> <div>
<span class="text-xs font-bold uppercase tracking-wider text-[#1b5e20] block mb-1"> <span class="text-xs font-bold uppercase tracking-wider text-[#1b5e20] block mb-1">
MANAJEMEN SISTEM MANAJEMEN SISTEM
</span> </span>
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<h2 class="text-3xl sm:text-4xl font-extrabold text-slate-900 tracking-tight"> <h2 class="text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight">
Log Aktivitas Kendaraan Log Aktivitas Kendaraan
</h2> </h2>
<span class="w-6 h-6 rounded-full bg-slate-200/90 text-slate-500 text-xs inline-flex items-center justify-center font-bold shadow-sm" title="Catatan komprehensif 10 kolom pergerakan armada kendaraan dengan validasi pos gerbang"> <span class="w-6 h-6 rounded-full bg-slate-200/90 text-slate-500 text-xs inline-flex items-center justify-center font-bold shadow-sm" title="Catatan pergerakan armada kendaraan dengan validasi pos gerbang">
<i class="fa-solid fa-info"></i> <i class="fa-solid fa-info"></i>
</span> </span>
</div> </div>
@@ -27,133 +27,256 @@
</div> </div>
</div> </div>
<!-- Filter Bar --> <!-- Filter Card Modern & Rapi -->
<div class="bg-white p-4 rounded-xl border border-slate-200 shadow-sm"> <div class="bg-white rounded-2xl border border-slate-200 shadow-sm p-4 sm:p-5">
<form method="GET" action="{{ route('qma.activity.log') }}" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-3"> <form method="GET" action="{{ route('qma.activity.log') }}" class="space-y-4">
<div> <!-- Header Filter -->
<label class="block text-xs font-semibold text-slate-600 mb-1">Mulai Tanggal</label> <div class="flex items-center justify-between pb-3 border-b border-slate-100">
<input type="date" name="start_date" value="{{ request('start_date') }}" class="w-full text-xs rounded-lg border-slate-300 border px-3 py-2"> <div class="flex items-center space-x-2 text-slate-800 font-bold text-xs uppercase tracking-wider">
<i class="fa-solid fa-sliders text-[#1b5e20]"></i>
<span>Filter & Pencarian Log</span>
</div>
@if(request()->hasAny(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
<a href="{{ route('qma.activity.log') }}" class="text-xs text-rose-600 hover:text-rose-700 font-semibold flex items-center space-x-1 transition">
<i class="fa-solid fa-rotate-left"></i>
<span>Reset Semua Filter</span>
</a>
@endif
</div> </div>
<div>
<label class="block text-xs font-semibold text-slate-600 mb-1">Sampai Tanggal</label> <!-- Baris Input Filter (Grid Responsif 12 Kolom) -->
<input type="date" name="end_date" value="{{ request('end_date') }}" class="w-full text-xs rounded-lg border-slate-300 border px-3 py-2"> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-12 gap-3.5">
<!-- Pencarian Cepat -->
<div class="lg:col-span-4">
<label class="block text-xs font-bold text-slate-700 mb-1.5 flex items-center gap-1.5">
<i class="fa-solid fa-magnifying-glass text-slate-400"></i>
<span>Pencarian Cepat</span>
</label>
<div class="relative">
<input type="text"
name="search"
value="{{ request('search') }}"
placeholder="Cari Kode LV, Driver, Plat, Keperluan..."
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3.5 py-2.5 text-slate-800 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
</div>
</div>
<!-- Rentang Mulai Tanggal -->
<div class="lg:col-span-2">
<label class="block text-xs font-bold text-slate-700 mb-1.5 flex items-center gap-1.5">
<i class="fa-regular fa-calendar text-slate-400"></i>
<span>Mulai Tanggal</span>
</label>
<input type="date"
name="start_date"
value="{{ request('start_date') }}"
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
</div>
<!-- Rentang Sampai Tanggal -->
<div class="lg:col-span-2">
<label class="block text-xs font-bold text-slate-700 mb-1.5 flex items-center gap-1.5">
<i class="fa-regular fa-calendar-check text-slate-400"></i>
<span>Sampai Tanggal</span>
</label>
<input type="date"
name="end_date"
value="{{ request('end_date') }}"
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
</div>
<!-- Pos Gerbang -->
<div class="lg:col-span-2">
<label class="block text-xs font-bold text-slate-700 mb-1.5 flex items-center gap-1.5">
<i class="fa-solid fa-torii-gate text-slate-400"></i>
<span>Pos Gerbang</span>
</label>
<select name="gate_id" class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
<option value="">Semua Gerbang</option>
@foreach($gates as $g)
<option value="{{ $g->id }}" {{ request('gate_id') == $g->id ? 'selected' : '' }}>{{ $g->name }}</option>
@endforeach
</select>
</div>
<!-- Arah Akses -->
<div class="lg:col-span-2">
<label class="block text-xs font-bold text-slate-700 mb-1.5 flex items-center gap-1.5">
<i class="fa-solid fa-arrows-left-right text-slate-400"></i>
<span>Arah Akses</span>
</label>
<select name="direction" class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
<option value="">Semua Arah</option>
<option value="in" {{ request('direction') === 'in' ? 'selected' : '' }}>MASUK (In)</option>
<option value="out" {{ request('direction') === 'out' ? 'selected' : '' }}>KELUAR (Out)</option>
</select>
</div>
</div> </div>
<div>
<label class="block text-xs font-semibold text-slate-600 mb-1">Pos Gerbang</label> <!-- Baris Aksi Bawah: Filter Status PG & Tombol -->
<select name="gate_id" class="w-full text-xs rounded-lg border-slate-300 border px-3 py-2"> <div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pt-3 border-t border-slate-100">
<option value="">Semua Gerbang</option> <!-- Status Validasi Pos Gerbang -->
@foreach($gates as $g) <div class="flex items-center space-x-2">
<option value="{{ $g->id }}" {{ request('gate_id') == $g->id ? 'selected' : '' }}>{{ $g->name }}</option> <span class="text-xs font-bold text-slate-600 whitespace-nowrap flex items-center gap-1">
@endforeach <i class="fa-solid fa-shield-halved text-slate-400"></i> Status PG:
</select> </span>
</div> <select name="status" class="text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-1.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
<div> <option value="">Semua Status</option>
<label class="block text-xs font-semibold text-slate-600 mb-1">Arah Akses</label> <option value="approved" {{ request('status') === 'approved' ? 'selected' : '' }}>Disetujui</option>
<select name="direction" class="w-full text-xs rounded-lg border-slate-300 border px-3 py-2"> <option value="pending" {{ request('status') === 'pending' ? 'selected' : '' }}>Menunggu PG</option>
<option value="">Semua Arah</option> <option value="rejected" {{ request('status') === 'rejected' ? 'selected' : '' }}>Ditolak</option>
<option value="in" {{ request('direction') === 'in' ? 'selected' : '' }}>MASUK (In)</option> </select>
<option value="out" {{ request('direction') === 'out' ? 'selected' : '' }}>KELUAR (Out)</option> </div>
</select>
</div> <!-- Tombol Submit & Reset -->
<div class="flex items-end space-x-2"> <div class="flex items-center space-x-2 justify-end">
<button type="submit" class="flex-1 bg-slate-800 hover:bg-slate-900 text-white text-xs font-bold py-2 px-3 rounded-lg transition"> <a href="{{ route('qma.activity.log') }}" class="px-4 py-2 rounded-xl text-xs font-semibold text-slate-600 bg-slate-100 hover:bg-slate-200 border border-slate-200 transition flex items-center space-x-1.5">
<i class="fa-solid fa-filter mr-1"></i> Filter <i class="fa-solid fa-rotate-left text-[11px]"></i>
</button> <span>Reset</span>
<a href="{{ route('qma.activity.log') }}" class="bg-slate-100 hover:bg-slate-200 text-slate-600 text-xs font-semibold py-2 px-3 rounded-lg border border-slate-300 transition"> </a>
Reset <button type="submit" class="px-5 py-2 rounded-xl text-xs font-bold text-white bg-[#06213f] hover:bg-[#0b315b] shadow-sm transition flex items-center space-x-2">
</a> <i class="fa-solid fa-filter text-[11px]"></i>
<span>Filter</span>
</button>
</div>
</div> </div>
</form> </form>
</div> </div>
<!-- Tabel 10 Kolom Log Aktivitas QMA --> <!-- Tabel Log Aktivitas (Header Navy Solid #06213f Tanpa Nomor Kolom) -->
<div class="bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden"> <div class="bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden">
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<table class="min-w-full divide-y divide-slate-200 text-xs text-left"> <table class="min-w-full text-xs text-left border-collapse">
<thead class="bg-slate-800 text-white font-semibold uppercase tracking-wider"> <thead class="bg-[#06213f] text-white font-bold text-[11px] uppercase tracking-wider">
<tr> <tr>
<th class="py-3 px-3 text-center">1. Tanggal</th> <th class="py-3.5 px-4 text-center whitespace-nowrap">Tanggal</th>
<th class="py-3 px-3 text-center">2. Kode LV</th> <th class="py-3.5 px-4 text-center whitespace-nowrap">Kode LV</th>
<th class="py-3 px-3">3. Unit</th> <th class="py-3.5 px-4 whitespace-nowrap">Unit</th>
<th class="py-3 px-3">4. Penanggung Jawab</th> <th class="py-3.5 px-4 whitespace-nowrap">Penanggung Jawab</th>
<th class="py-3 px-3">5. Driver</th> <th class="py-3.5 px-4 whitespace-nowrap">Driver</th>
<th class="py-3 px-3 text-center">6. Gate</th> <th class="py-3.5 px-4 text-center whitespace-nowrap">Gate</th>
<th class="py-3 px-3 text-center">7. Akses</th> <th class="py-3.5 px-4 text-center whitespace-nowrap">Akses</th>
<th class="py-3 px-3 text-right">8. KM Sebelumnya</th> <th class="py-3.5 px-4 text-right whitespace-nowrap">KM Sebelumnya</th>
<th class="py-3 px-3 text-right">9. KM Berjalan</th> <th class="py-3.5 px-4 text-right whitespace-nowrap">KM Berjalan</th>
<th class="py-3 px-3">10. Aktifitas</th> <th class="py-3.5 px-4 whitespace-nowrap">Aktivitas</th>
<th class="py-3 px-3 text-center">Status PG</th> <th class="py-3.5 px-4 text-center whitespace-nowrap">Status PG</th>
</tr> </tr>
</thead> </thead>
<tbody class="divide-y divide-slate-200 text-slate-700 bg-white"> <tbody class="divide-y divide-slate-100 text-slate-700 bg-white">
@forelse($activities as $act) @forelse($activities as $act)
<tr class="hover:bg-slate-50 transition"> <tr class="hover:bg-slate-50/70 transition">
<td class="py-3 px-3 text-center font-medium text-slate-600 whitespace-nowrap"> <!-- Tanggal & Waktu -->
{{ $act->recorded_at->format('d/m/Y H:i') }} <td class="py-3.5 px-4 text-center whitespace-nowrap">
<div class="font-bold text-slate-900">{{ $act->recorded_at->format('d/m/Y') }}</div>
<div class="text-[10px] font-mono text-slate-400 font-medium">{{ $act->recorded_at->format('H:i') }} WIB</div>
</td> </td>
<td class="py-3 px-3 text-center font-bold text-slate-900 whitespace-nowrap">
<span class="bg-slate-100 px-2 py-0.5 rounded border border-slate-300 font-mono"> <!-- Kode LV -->
<td class="py-3.5 px-4 text-center whitespace-nowrap font-mono">
<span class="inline-block bg-emerald-50 text-emerald-800 font-bold px-2.5 py-1 rounded border border-emerald-200">
{{ $act->vehicle->code }} {{ $act->vehicle->code }}
</span> </span>
</td> </td>
<td class="py-3 px-3 font-medium text-slate-800">
<div>{{ $act->vehicle->brand_type }}</div> <!-- Unit & Plat -->
<span class="text-[10px] text-amber-700 font-mono">{{ $act->vehicle->license_plate ?? '-' }}</span> <td class="py-3.5 px-4">
<div class="font-bold text-slate-900">{{ $act->vehicle->brand_type }}</div>
@if($act->vehicle->license_plate)
<span class="inline-block text-[10px] font-mono font-bold text-amber-800 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 mt-0.5">
{{ $act->vehicle->license_plate }}
</span>
@else
<span class="text-[10px] text-slate-400 italic">-</span>
@endif
</td> </td>
<td class="py-3 px-3 text-slate-600">
<!-- Penanggung Jawab -->
<td class="py-3.5 px-4 text-slate-600 font-medium">
{{ $act->vehicle->ownership ?? '-' }} {{ $act->vehicle->ownership ?? '-' }}
</td> </td>
<td class="py-3 px-3 font-semibold text-slate-900">
{{ $act->driver->name }} <!-- Driver -->
<td class="py-3.5 px-4">
<div class="font-bold text-slate-900">{{ $act->driver->name }}</div>
<div class="text-[10px] text-slate-400 font-normal">{{ $act->driver->division ?? '-' }}</div> <div class="text-[10px] text-slate-400 font-normal">{{ $act->driver->division ?? '-' }}</div>
</td> </td>
<td class="py-3 px-3 text-center whitespace-nowrap">
<span class="inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium bg-slate-100 text-slate-700 border border-slate-200"> <!-- Gate -->
<td class="py-3.5 px-4 text-center whitespace-nowrap">
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-semibold bg-slate-100 text-slate-700 border border-slate-200">
{{ $act->gate->name }} {{ $act->gate->name }}
</span> </span>
</td> </td>
<td class="py-3 px-3 text-center whitespace-nowrap">
<!-- Akses (In / Out) -->
<td class="py-3.5 px-4 text-center whitespace-nowrap">
@if($act->direction === 'in') @if($act->direction === 'in')
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-800 border border-emerald-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-full text-[10px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200">
<i class="fa-solid fa-arrow-right-to-bracket mr-1"></i> MASUK <i class="fa-solid fa-arrow-right-to-bracket mr-1.5 text-emerald-600"></i> MASUK
</span> </span>
@else @else
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-bold bg-blue-100 text-blue-800 border border-blue-200"> <span class="inline-flex items-center px-2.5 py-1 rounded-full text-[10px] font-bold bg-blue-50 text-blue-700 border border-blue-200">
<i class="fa-solid fa-arrow-right-from-bracket mr-1"></i> KELUAR <i class="fa-solid fa-arrow-right-from-bracket mr-1.5 text-blue-600"></i> KELUAR
</span> </span>
@endif @endif
</td> </td>
<td class="py-3 px-3 text-right font-mono font-medium text-slate-600 whitespace-nowrap">
{{ number_format($act->previous_km, 0, ',', '.') }} KM <!-- KM Sebelumnya -->
<td class="py-3.5 px-4 text-right font-mono font-medium text-slate-600 whitespace-nowrap">
{{ number_format($act->previous_km, 0, ',', '.') }}
<span class="text-[10px] text-slate-400 font-sans font-normal">KM</span>
</td> </td>
<td class="py-3 px-3 text-right font-mono font-bold text-emerald-600 whitespace-nowrap">
+{{ number_format($act->distance, 0, ',', '.') }} KM <!-- KM Berjalan & Akhir -->
<div class="text-[10px] text-slate-400 font-normal">Akhir: {{ number_format($act->current_km, 0, ',', '.') }}</div> <td class="py-3.5 px-4 text-right font-mono whitespace-nowrap">
<div class="font-bold text-emerald-600 text-xs">
+{{ number_format($act->distance, 0, ',', '.') }} <span class="text-[10px] font-sans font-normal">KM</span>
</div>
<div class="text-[10px] text-slate-400 font-normal">
Akhir: {{ number_format($act->current_km, 0, ',', '.') }}
</div>
</td> </td>
<td class="py-3 px-3 text-slate-600 max-w-xs truncate" title="{{ $act->purpose }}">
{{ $act->purpose }} <!-- Aktivitas -->
<td class="py-3.5 px-4 text-slate-700 max-w-xs" title="{{ $act->purpose }}">
<div class="truncate">{{ $act->purpose }}</div>
</td> </td>
<td class="py-3 px-3 text-center whitespace-nowrap">
<!-- Status PG -->
<td class="py-3.5 px-4 text-center whitespace-nowrap">
@if($act->validation_status === 'approved') @if($act->validation_status === 'approved')
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-300" title="Divalidasi oleh: {{ $act->securityGuard->name ?? 'Satpam' }}"> <span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200" title="Divalidasi oleh: {{ $act->securityGuard->name ?? 'Satpam' }}">
<i class="fa-solid fa-circle-check mr-1"></i> Disetujui <i class="fa-solid fa-circle-check mr-1 text-emerald-600"></i> Disetujui
</span> </span>
@elseif($act->validation_status === 'rejected') @elseif($act->validation_status === 'rejected')
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-rose-50 text-rose-700 border border-rose-300" title="Alasan: {{ $act->rejection_note }}"> <span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-rose-50 text-rose-700 border border-rose-200" title="Alasan: {{ $act->rejection_note }}">
<i class="fa-solid fa-circle-xmark mr-1"></i> Ditolak <i class="fa-solid fa-circle-xmark mr-1 text-rose-600"></i> Ditolak
</span> </span>
@else @else
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-amber-50 text-amber-700 border border-amber-300 animate-pulse"> <span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-amber-50 text-amber-700 border border-amber-200 animate-pulse">
<i class="fa-solid fa-clock mr-1"></i> Menunggu PG <i class="fa-solid fa-clock mr-1 text-amber-600"></i> Menunggu PG
</span> </span>
@endif @endif
</td> </td>
</tr> </tr>
@empty @empty
<tr> <tr>
<td colspan="11" class="py-8 text-center text-slate-400"> <td colspan="11" class="py-12 px-4 text-center">
<i class="fa-solid fa-inbox text-3xl mb-2 block"></i> <div class="flex flex-col items-center justify-center space-y-3">
Belum ada catatan aktivitas kendaraan yang sesuai dengan kriteria filter. <div class="w-14 h-14 rounded-full bg-slate-100 flex items-center justify-center text-slate-400 text-2xl">
<i class="fa-solid fa-route"></i>
</div>
<div class="text-sm font-bold text-slate-700">Belum Ada Data Log Aktivitas</div>
<p class="text-xs text-slate-400 max-w-sm">
Tidak ditemukan catatan aktivitas kendaraan yang sesuai dengan kriteria filter saat ini.
</p>
@if(request()->hasAny(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
<a href="{{ route('qma.activity.log') }}" class="mt-2 inline-flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold text-[#1b5e20] bg-emerald-50 border border-emerald-200 hover:bg-emerald-100 transition">
<i class="fa-solid fa-rotate-left text-[11px]"></i>
<span>Reset Filter</span>
</a>
@endif
</div>
</td> </td>
</tr> </tr>
@endforelse @endforelse
@@ -162,9 +285,11 @@
</div> </div>
<!-- Pagination --> <!-- Pagination -->
<div class="p-4 bg-slate-50 border-t border-slate-200"> @if($activities->hasPages())
{{ $activities->links() }} <div class="p-4 bg-slate-50 border-t border-slate-100">
</div> {{ $activities->links() }}
</div>
@endif
</div> </div>
</div> </div>
@endsection @endsection
+11 -11
View File
@@ -170,16 +170,16 @@ class VehicleActivityTest extends TestCase
$qmaAdmin = User::where('role', 'qma_admin')->first(); $qmaAdmin = User::where('role', 'qma_admin')->first();
$response = $this->actingAs($qmaAdmin)->get('/qma/activity-log'); $response = $this->actingAs($qmaAdmin)->get('/qma/activity-log');
$response->assertStatus(200); $response->assertStatus(200);
$response->assertSee('Log Aktivitas Kendaraan QMA'); $response->assertSee('Log Aktivitas Kendaraan');
$response->assertSee('1. Tanggal'); $response->assertSee('Tanggal');
$response->assertSee('2. Kode LV'); $response->assertSee('Kode LV');
$response->assertSee('3. Unit'); $response->assertSee('Unit');
$response->assertSee('4. Penanggung Jawab'); $response->assertSee('Penanggung Jawab');
$response->assertSee('5. Driver'); $response->assertSee('Driver');
$response->assertSee('6. Gate'); $response->assertSee('Gate');
$response->assertSee('7. Akses'); $response->assertSee('Akses');
$response->assertSee('8. KM Sebelumnya'); $response->assertSee('KM Sebelumnya');
$response->assertSee('9. KM Berjalan'); $response->assertSee('KM Berjalan');
$response->assertSee('10. Aktifitas'); $response->assertSee('Aktivitas');
} }
} }