Normalise usage of Model into Model::class strings
This commit is contained in:
parent
820ff2be00
commit
dc74a064ba
@ -20,7 +20,7 @@ class ProductController extends Controller
|
|||||||
public function api_supplier_products(Request $request): Collection
|
public function api_supplier_products(Request $request): Collection
|
||||||
{
|
{
|
||||||
switch ($request->type) {
|
switch ($request->type) {
|
||||||
case 'App\Models\Product\Broadband':
|
case Product\Broadband::class:
|
||||||
return Product\Broadband::select(['id','supplier_item_id'])
|
return Product\Broadband::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
@ -28,7 +28,7 @@ class ProductController extends Controller
|
|||||||
->sortBy('name')
|
->sortBy('name')
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
case 'App\Models\Product\Domain':
|
case Product\Domain::class:
|
||||||
return Product\Domain::select(['id','supplier_item_id'])
|
return Product\Domain::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
@ -36,7 +36,7 @@ class ProductController extends Controller
|
|||||||
->sortBy('name')
|
->sortBy('name')
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
case 'App\Models\Product\Email':
|
case Product\Email::class:
|
||||||
return Product\Email::select(['id','supplier_item_id'])
|
return Product\Email::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
@ -44,7 +44,7 @@ class ProductController extends Controller
|
|||||||
->sortBy('name')
|
->sortBy('name')
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
case 'App\Models\Product\Generic':
|
case Product\Generic::class:
|
||||||
return Product\Generic::select(['id','supplier_item_id'])
|
return Product\Generic::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
@ -52,7 +52,7 @@ class ProductController extends Controller
|
|||||||
->sortBy('name')
|
->sortBy('name')
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
case 'App\Models\Product\Host':
|
case Product\Host::class:
|
||||||
return Product\Host::select(['id','supplier_item_id'])
|
return Product\Host::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
@ -60,7 +60,7 @@ class ProductController extends Controller
|
|||||||
->sortBy('name')
|
->sortBy('name')
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
case 'App\Models\Product\Phone':
|
case Product\Phone::class:
|
||||||
return Product\Phone::select(['id','supplier_item_id'])
|
return Product\Phone::select(['id','supplier_item_id'])
|
||||||
->with(['supplied.supplier_detail.supplier'])
|
->with(['supplied.supplier_detail.supplier'])
|
||||||
->get()
|
->get()
|
||||||
|
@ -39,11 +39,11 @@ class CancelRequest extends Mailable
|
|||||||
Config::set('site',$this->service->site);
|
Config::set('site',$this->service->site);
|
||||||
|
|
||||||
switch (get_class($this->service->type)) {
|
switch (get_class($this->service->type)) {
|
||||||
case 'App\Models\Service\Broadband':
|
case Service\Broadband::class:
|
||||||
$subject = sprintf('Cancel BROADBAND: %s',$this->service->type->service_address);
|
$subject = sprintf('Cancel BROADBAND: %s',$this->service->type->service_address);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'App\Models\Service\Phone':
|
case Service\Phone::class:
|
||||||
$subject = sprintf('Cancel PHONE: %s',$this->service->type->service_number);
|
$subject = sprintf('Cancel PHONE: %s',$this->service->type->service_number);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ class ChangeRequest extends Mailable
|
|||||||
Config::set('site',$this->service->site);
|
Config::set('site',$this->service->site);
|
||||||
|
|
||||||
switch (get_class($this->service->type)) {
|
switch (get_class($this->service->type)) {
|
||||||
case 'App\Models\Service\Broadband':
|
case Service\Broadband::class:
|
||||||
$subject = sprintf('Change BROADBAND: %s',$this->service->type->service_address);
|
$subject = sprintf('Change BROADBAND: %s',$this->service->type->service_address);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'App\Models\Service\Phone':
|
case Service\Phone::class:
|
||||||
$subject = sprintf('Change PHONE: %s',$this->service->type->service_number);
|
$subject = sprintf('Change PHONE: %s',$this->service->type->service_number);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ class OrderRequest extends Mailable
|
|||||||
Config::set('site',$this->service->site);
|
Config::set('site',$this->service->site);
|
||||||
|
|
||||||
switch (get_class($this->service->type)) {
|
switch (get_class($this->service->type)) {
|
||||||
case 'App\Models\Service\Broadband':
|
case Service\Broadband::class:
|
||||||
$subject = sprintf('Order BROADBAND: %s',$this->service->type->service_address);
|
$subject = sprintf('Order BROADBAND: %s',$this->service->type->service_address);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'App\Models\Service\Phone':
|
case Service\Phone::class:
|
||||||
$subject = sprintf('Order PHONE: %s',$this->service->type->service_number);
|
$subject = sprintf('Order PHONE: %s',$this->service->type->service_number);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'user' => 'App\Models\User',
|
'user' => \App\Models\User::class,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -29,7 +29,7 @@ class GroupFactory extends Factory
|
|||||||
// 'date_expire',
|
// 'date_expire',
|
||||||
// 'parent_id',
|
// 'parent_id',
|
||||||
'active' => TRUE,
|
'active' => TRUE,
|
||||||
// 'pricing',
|
'pricing' => TRUE,
|
||||||
// 'name',
|
// 'name',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ class ProductFactory extends Factory
|
|||||||
]),
|
]),
|
||||||
// 'price_recur_default'
|
// 'price_recur_default'
|
||||||
// 'price_recur_strict'
|
// 'price_recur_strict'
|
||||||
// 'model_id' => 1,
|
'model_id' => 1,
|
||||||
// 'accounting'
|
// 'accounting'
|
||||||
// 'model' => 'App\Models\Product\Adsl',
|
'model' => Product\Broadband::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class ServiceFactory extends Factory
|
|||||||
// 'ordered_by',
|
// 'ordered_by',
|
||||||
// 'order_status',
|
// 'order_status',
|
||||||
// 'order_info',
|
// 'order_info',
|
||||||
'model' => 'App\Models\Service\Broadband',
|
'model' => Service\Broadband::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@php
|
@php
|
||||||
$po = $selected = NULL;
|
$po = $selected = NULL;
|
||||||
@endphp
|
@endphp
|
||||||
@foreach (\App\Models\Product::active()->get()->filter(function($item) { return get_class($item->type) === 'App\Models\Product\Broadband'; })->sortBy('name') as $o)
|
@foreach (\App\Models\Product::active()->get()->filter(function($item) { return get_class($item->type) === \App\Models\Product\Broadband::class; })->sortBy('name') as $o)
|
||||||
@php
|
@php
|
||||||
if ($o->id == old('product_id')) {
|
if ($o->id == old('product_id')) {
|
||||||
$selected = 'selected';
|
$selected = 'selected';
|
||||||
|
Loading…
Reference in New Issue
Block a user