Added hosting report and enabled updating hosting details
This commit is contained in:
@@ -35,6 +35,14 @@ class ProductController extends Controller
|
||||
->sortBy('name')
|
||||
->values();
|
||||
|
||||
case 'App\Models\Product\Host':
|
||||
return Product\Host::select(['id','supplier_host_id'])
|
||||
->with(['supplied.supplier_detail.supplier'])
|
||||
->get()
|
||||
->map(function($item) { return ['id'=>$item->id,'name'=>sprintf('%s: %s',$item->supplied->supplier_detail->supplier->name,$item->supplied->name)]; })
|
||||
->sortBy('name')
|
||||
->values();
|
||||
|
||||
default:
|
||||
throw new \Exception('Unknown type: '.$request->type);
|
||||
}
|
||||
|
@@ -269,6 +269,20 @@ class ServiceController extends Controller
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
public function hosting_list(): View
|
||||
{
|
||||
// @todo Need to add the with path when calculating next_billed and price
|
||||
$o = Service\Host::serviceActive()
|
||||
->serviceUserAuthorised(Auth::user())
|
||||
->select('ab_service__hosting.*')
|
||||
->join('ab_service',['ab_service.id'=>'ab_service__hosting.service_id'])
|
||||
->with(['service.account','service.product.type.supplied.supplier_detail.supplier','tld'])
|
||||
->get();
|
||||
|
||||
return view('r.service.host.list')
|
||||
->with('o',$o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update details about a service
|
||||
*
|
||||
|
Reference in New Issue
Block a user