add missing create
This commit is contained in:
parent
88e5379610
commit
8a2700c554
1 changed files with 29 additions and 0 deletions
|
|
@ -25,10 +25,39 @@
|
|||
$prop['readonly'] = false;
|
||||
@endphp
|
||||
@if(in_array(CrudAction::create(), $prop['actions']))
|
||||
@if($fieldName === 'tasks')
|
||||
<div class="row">
|
||||
<div class="col-3 border border-secondary py-1 px-1">
|
||||
<label for="total" class="form-label">{{ $prop['label'] ?? $fieldName }}</label>
|
||||
</div>
|
||||
<div class="col-9 border border-secondary py-1 px-1">
|
||||
@php
|
||||
$taskTypeEnums = collect(App\Enums\Invoice\TaskType::toArray())->map(function($enum) {
|
||||
return [
|
||||
'value' => $enum->value,
|
||||
'label' => $enum->label,
|
||||
'price' => $enum->price,
|
||||
];
|
||||
});
|
||||
$dataVue = [
|
||||
'tasks'=> old($fieldName) ? json_decode(old($fieldName), true): $model->{$fieldName} ?? [],
|
||||
'companies' => $companies,
|
||||
'packages' => $packages,
|
||||
'taskRowModel' => $taskRowModel,
|
||||
'taskTypeEnums' => $taskTypeEnums,
|
||||
];
|
||||
@endphp
|
||||
<div
|
||||
id="invoice-tasks"
|
||||
data-json='@json($dataVue)'></div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
@include('crud-policies::crud.formfield')
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue