fix: restore table-based layout and display owner data for showcars

This commit is contained in:
2026-05-01 12:19:39 -04:00
parent 0fd6a6c3e2
commit 7c88db310d
2 changed files with 29 additions and 8 deletions
+1 -1
View File
@@ -407,7 +407,7 @@ class PagesController extends Controller
public function showcars(Request $showcar_req)
{
if (!$showcar_req->bidderlname) {
$vehicles = \App\Models\Vehicles::all();
$vehicles = \App\Models\Vehicles::with('vehicleOwner')->get();
return view('showcars', ['vehicles' => $vehicles]);
}
$bidder_lname = $showcar_req->bidderlname;
+28 -7
View File
@@ -13,17 +13,38 @@
<div class="page-body">
<div class="container-xl">
<div class="row row-cards">
@foreach($vehicles as $vehicle)
<div class="col-md-6 col-lg-4">
<div class="col-12">
<div class="card">
<div class="card-body">
<h3 class="card-title">{{ $vehicle->make }} {{ $vehicle->model }}</h3>
<p class="text-muted">Year: {{ $vehicle->year }}</p>
<p class="text-muted">Owner: {{ $vehicle->owner_name }}</p>
<div class="table-responsive">
<table class="table table-vcenter card-table">
<thead>
<tr>
<th>Make</th>
<th>Model</th>
<th>Year</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
@foreach($vehicles as $vehicle)
<tr>
<td>{{ $vehicle->make }}</td>
<td>{{ $vehicle->model }}</td>
<td>{{ $vehicle->year }}</td>
<td>
@if($vehicle->vehicleOwner)
{{ $vehicle->vehicleOwner->bidder_fname }} {{ $vehicle->vehicleOwner->bidder_lname }}
@else
N/A
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>