- Implemented dashboard view with vehicle stats, active services, recent activity, and upcoming appointments. - Created estimates view with filtering options and a list of service estimates. - Developed invoices view to manage service invoices and payment history with filtering. - Added vehicles view to display registered vehicles and their details. - Built work orders view to track the progress of vehicle services with filtering and detailed information.
30 lines
743 B
PHP
30 lines
743 B
PHP
<?php
|
|
|
|
namespace App\Livewire\CustomerPortal;
|
|
|
|
use App\Models\Vehicle;
|
|
use App\Models\Customer;
|
|
use Livewire\Component;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class Vehicles extends Component
|
|
{
|
|
public function render()
|
|
{
|
|
$user = Auth::user();
|
|
$customer = Customer::where('email', $user->email)->first();
|
|
|
|
$vehicles = collect();
|
|
|
|
if ($customer) {
|
|
$vehicles = Vehicle::where('customer_id', $customer->id)
|
|
->withCount(['jobCards', 'appointments'])
|
|
->orderBy('created_at', 'desc')
|
|
->get();
|
|
}
|
|
|
|
return view('livewire.customer-portal.vehicles', compact('vehicles'))
|
|
->layout('layouts.customer-portal-app');
|
|
}
|
|
}
|