add missing create

This commit is contained in:
Jérémy Munsch 2022-08-30 09:26:47 +02:00
parent 88e5379610
commit 8a2700c554
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -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">