diff --git a/resources/views/admin/formElements/select.blade.php b/resources/views/admin/formElements/select.blade.php index 1c3d882..7cb48b3 100644 --- a/resources/views/admin/formElements/select.blade.php +++ b/resources/views/admin/formElements/select.blade.php @@ -1,6 +1,6 @@
{!! Form::label($fieldName, $options['label']) !!} - {!! Form::select($fieldName, [null => 'Select '.$options['label']] + $options['select_options'], $record->{$fieldName}, ['class' => 'form-control']) !!} + {!! Form::select($fieldName, [null => 'Select '.$options['label']] + $record->{$options['selectOptions']}(), $record->{$fieldName}, ['class' => 'form-control']) !!}
{{ join($errors->get($fieldName), '
') }}
diff --git a/src/Admin/Observers/AdminObserver.php b/src/Admin/Observers/AdminObserver.php index c6f134e..782a68c 100644 --- a/src/Admin/Observers/AdminObserver.php +++ b/src/Admin/Observers/AdminObserver.php @@ -16,10 +16,11 @@ class AdminObserver */ public function saving(Model $model) { - if ($model instanceof UploadImagesTrait) { + if (in_array(UploadImagesTrait::class, class_uses($model))) { $model->saveImages(); } - if ($model instanceof UploadFilesTrait) { + + if (in_array(UploadFilesTrait::class, class_uses($model))) { $model->saveFiles(); } } diff --git a/src/Console/Commands/Compilers/ResourceCompiler.php b/src/Console/Commands/Compilers/ResourceCompiler.php index 9f91104..ac3b34a 100644 --- a/src/Console/Commands/Compilers/ResourceCompiler.php +++ b/src/Console/Commands/Compilers/ResourceCompiler.php @@ -166,7 +166,7 @@ public function render_config($template) { if ($this->options['image_uploads']) { $this->configReplacements[':image_fields'] = "'image_fields' => [ - 'image' => [ + 'image' => [ 'thumbnails' => [ 'admin' => [ 'width' => 150,