From ec3a15d5e903a87b36e83cd05773ea42cebac742 Mon Sep 17 00:00:00 2001 From: Francis Nduba Numbi Date: Sun, 26 Nov 2023 16:15:57 +0200 Subject: [PATCH] fix missing @endif in select.blade --- resources/views/components/select.blade.php | 64 +++++++++++---------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/resources/views/components/select.blade.php b/resources/views/components/select.blade.php index bb519a4..da396a9 100644 --- a/resources/views/components/select.blade.php +++ b/resources/views/components/select.blade.php @@ -1,41 +1,42 @@ @props([ - 'label'=>null, - 'placeholder' => null, - 'multiple'=>false, - 'allowClear'=>false, - 'prepend'=>null, - 'refresh'=>false, - 'change'=>false, - 'options'=>null, - ]) +'label'=>null, +'placeholder' => null, +'multiple'=>false, +'allowClear'=>false, +'prepend'=>null, +'refresh'=>false, +'change'=>false, +'options'=>null, +]) @php - if ($multiple) { - $attributes = $attributes->merge(['multiple' => 'multiple']); - } - $model = $attributes['name'] ?? $attributes->wire('model')->value(); - $id = SmirlTech\LaravelForm\Helpers\Helpers::modelToFucntionName($model); - if ($errors->has($model)) { - $error = $errors->first($model); - $error_class = 'is-invalid'; - } else { - $error = ''; - $error_class = ''; - } +if ($multiple) { +$attributes = $attributes->merge(['multiple' => 'multiple']); +} +$model = $attributes['name'] ?? $attributes->wire('model')->value(); +$id = SmirlTech\LaravelForm\Helpers\Helpers::modelToFucntionName($model); +if ($errors->has($model)) { +$error = $errors->first($model); +$error_class = 'is-invalid'; +} else { +$error = ''; +$error_class = ''; +} @endphp
@include('form::partials.label') @if($refresh or $change) - + @else - + + @endif
@@ -51,10 +52,13 @@ setFirstOptionActive: true, placeholder: '{{$placeholder ?? 'Choisir '.$label ?? ''}}', onChange: function (value) { - @if($attributes->wire('model')->value()) - @this. - set('{{$model}}', value); - @endif + @ + if ($attributes->wire('model')-> + value() + ) + @this.set('{{$model}}', value) + ; + @endif }, }); });