sackey cbae4564b9
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Add customer portal views for dashboard, estimates, invoices, vehicles, and work orders
- 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.
2025-08-08 09:56:26 +00:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Livewire\CustomerPortal;
use App\Models\JobCard;
use App\Models\Customer;
use Livewire\Component;
use Livewire\WithPagination;
use Illuminate\Support\Facades\Auth;
class WorkOrders extends Component
{
use WithPagination;
public $filterStatus = '';
public function updatingFilterStatus()
{
$this->resetPage();
}
public function render()
{
$user = Auth::user();
$customer = Customer::where('email', $user->email)->first();
$workOrders = collect();
if ($customer) {
$workOrders = JobCard::where('customer_id', $customer->id)
->when($this->filterStatus, function ($query) {
$query->where('status', $this->filterStatus);
})
->with(['vehicle', 'serviceAdvisor', 'estimates'])
->orderBy('created_at', 'desc')
->paginate(10);
}
return view('livewire.customer-portal.work-orders', compact('workOrders'))
->layout('layouts.customer-portal-app');
}
}