Added hosting report and enabled updating hosting details

This commit is contained in:
Deon George
2022-04-02 20:26:59 +11:00
parent edc06e51fb
commit 9659621ba0
11 changed files with 275 additions and 19 deletions

View File

@@ -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);
}