33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Portal\Http\Controllers\Customer;
|
|
|
|
use Modules\Portal\Http\Controllers\BasePortalController;
|
|
use Modules\Repair\Entities\JobSheet;
|
|
|
|
class RepairController extends BasePortalController
|
|
{
|
|
public function index()
|
|
{
|
|
$this->ensureCrmSubscription();
|
|
$jobSheets = JobSheet::where('business_id', $this->businessId())
|
|
->where('contact_id', $this->contactId())
|
|
->with(['status', 'Brand', 'DeviceModel', 'technician:id,first_name,last_name'])
|
|
->orderByDesc('created_at')
|
|
->paginate(20);
|
|
|
|
return view('portal::customer.repairs.index', compact('jobSheets'));
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
$this->ensureCrmSubscription();
|
|
$jobSheet = JobSheet::where('business_id', $this->businessId())
|
|
->where('contact_id', $this->contactId())
|
|
->with(['status', 'Brand', 'DeviceModel', 'technician', 'media'])
|
|
->findOrFail($id);
|
|
|
|
return view('portal::customer.repairs.show', compact('jobSheet'));
|
|
}
|
|
}
|