2026-02-19 22:05:20 +00:00

51 lines
2.5 KiB
PHP

@extends('layouts.app')
@section('title', 'Payments')
@section('content')
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-xl font-bold text-gray-800">Payments</h2>
<p class="text-gray-500 text-sm">Track payments</p>
</div>
<a href="{{ route('payments.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 flex items-center gap-2 text-sm font-medium">
<i class="fas fa-plus"></i> Record Payment
</a>
</div>
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50 border-b border-gray-200">
<tr>
<th class="px-5 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Rental</th>
<th class="px-5 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Amount</th>
<th class="px-5 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Method</th>
<th class="px-5 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Status</th>
<th class="px-5 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Date</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse($payments as $payment)
<tr class="hover:bg-gray-50">
<td class="px-5 py-4 text-gray-800 text-sm">{{ $payment->rental->car->brand }} {{ $payment->rental->car->model }}</td>
<td class="px-5 py-4 font-medium text-gray-800 text-sm"> BHD {{ number_format($payment->amount, 0) }}</td>
<td class="px-5 py-4 text-gray-600 text-sm capitalize">{{ $payment->method }}</td>
<td class="px-5 py-4">
<span class="px-2.5 py-1 rounded-full text-xs font-medium
{{ $payment->status == 'completed' ? 'bg-green-100 text-green-700' :
($payment->status == 'pending' ? 'bg-amber-100 text-amber-700' : 'bg-red-100 text-red-700') }}">
{{ ucfirst($payment->status) }}
</span>
</td>
<td class="px-5 py-4 text-gray-600 text-sm">{{ $payment->created_at->format('M d, Y') }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-5 py-8 text-center text-gray-500">No payments recorded</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@endsection