From 13f6dcc2a9b77b14e2614f671f961719da607f88 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 26 Nov 2020 09:09:07 +0100 Subject: [PATCH] wip #3753 @0.25 --- src/app/Magic/Fields/ModelAttribute.php | 13 +++++++++++++ src/app/Magic/Fields/StaticValue.php | 4 ++++ src/resources/views/fields/static_value.blade.php | 4 +--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/app/Magic/Fields/ModelAttribute.php diff --git a/src/app/Magic/Fields/ModelAttribute.php b/src/app/Magic/Fields/ModelAttribute.php new file mode 100644 index 0000000..c459e3a --- /dev/null +++ b/src/app/Magic/Fields/ModelAttribute.php @@ -0,0 +1,13 @@ +getAttribute('attributes'); + } +} diff --git a/src/app/Magic/Fields/StaticValue.php b/src/app/Magic/Fields/StaticValue.php index 3b1375f..372367b 100644 --- a/src/app/Magic/Fields/StaticValue.php +++ b/src/app/Magic/Fields/StaticValue.php @@ -12,4 +12,8 @@ class StaticValue extends Field protected $_translatable = false; protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields'; + public function filterValue($value) + { + return $this->getAttribute('value'); + } } diff --git a/src/resources/views/fields/static_value.blade.php b/src/resources/views/fields/static_value.blade.php index 6c02776..ef9b4c4 100644 --- a/src/resources/views/fields/static_value.blade.php +++ b/src/resources/views/fields/static_value.blade.php @@ -2,9 +2,7 @@ @include('crud::fields.inc.wrapper_start') @include('crud::fields.inc.translatable_icon') - -@if(isset($field['prefix']) || isset($field['suffix']))
@endif - {{ old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? '' }}" +
{{ old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? '' }}
{{-- HINT --}} @if (isset($field['hint']))

{!! $field['hint'] !!}

-- 2.39.5