No longer need to test for type, it should exist
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="col-12">
|
||||
<h3>Product Details @include('adminlte::widget.success_button')</h3>
|
||||
<hr>
|
||||
@dump($errors)
|
||||
|
||||
<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
|
||||
@csrf
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
'old'=>'model',
|
||||
'name'=>'model',
|
||||
'options'=>$o->availableTypes()->transform(function($item) { return ['id'=>$item,'value'=>$item]; }),
|
||||
'value'=>($o->type && $x=get_class($o->type)) ? $x : '',
|
||||
'value'=>get_class($o->type),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
@php
|
||||
$po = $selected = NULL;
|
||||
@endphp
|
||||
@foreach (\App\Models\Product::active()->get()->filter(function($item) { return $item->type && (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'; })->sortBy('name') as $o)
|
||||
@php
|
||||
if ($o->id == old('product_id')) {
|
||||
$selected = 'selected';
|
||||
|
Reference in New Issue
Block a user