diff --git a/resources/views/fields/select.blade.php b/resources/views/fields/select.blade.php index 47c1388d..a445ef0d 100644 --- a/resources/views/fields/select.blade.php +++ b/resources/views/fields/select.blade.php @@ -10,21 +10,21 @@
{!! $prefix !!}
@endif + @foreach($options as $option) + @if(isset($option['options'])) + + @foreach($option['options'] as $o) + + @endforeach + + @else + + @endif + @endforeach + @if($suffix)
{!! $suffix !!}
@endif diff --git a/src/Fields/MorphTo.php b/src/Fields/MorphTo.php index 37cb527d..2a22868f 100644 --- a/src/Fields/MorphTo.php +++ b/src/Fields/MorphTo.php @@ -56,9 +56,9 @@ public function resolveHydrate(Request $request, Model $model, mixed $value): vo $model->setAttribute($this->getRelation($model)->getMorphType(), $value[0]); - $related = new $value[0]; - - $related->forceFill([$related->getKeyName() => $value[1]]); + $related = tap(new $value[0], static function (Model $related) use ($value): void { + $related->forceFill([$related->getKeyName() => $value[1]]); + }); parent::resolveHydrate($request, $model, $related); }