]> _ Git - cubist_cms-back.git/commitdiff
wip #3546
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 1 Apr 2020 16:24:52 +0000 (18:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 1 Apr 2020 16:24:52 +0000 (18:24 +0200)
src/app/Magic/Models/CubistMagicAuthenticatable.php
src/resources/views/fields/hidden.blade.php [new file with mode: 0644]

index 55debd952d9cd9a49bb3e9a6f241e31bf0dd7c62..c65abc1ab0e2fd8fa84d1ec938fdf18c72cdc42e 100644 (file)
@@ -52,7 +52,8 @@ class CubistMagicAuthenticatable extends CubistMagicAbstractModel
 
         $this->addField(['name' => 'remember_token',
             'type' => 'Text',
-            'hidden' => true]);
+            'hidden' => true,
+            'fillable' => false]);
 
 
         $this->addField(['name' => 'email',
diff --git a/src/resources/views/fields/hidden.blade.php b/src/resources/views/fields/hidden.blade.php
new file mode 100644 (file)
index 0000000..b1834db
--- /dev/null
@@ -0,0 +1,17 @@
+@php
+       // if not otherwise specified, the hidden input should take up no space in the form
+    if (!isset($field['wrapperAttributes']) || !isset($field['wrapperAttributes']['class']))
+    {
+        $field['wrapperAttributes']['class'] = "hidden";
+    }
+@endphp
+
+<!-- hidden input -->
+<div @include('crud::inc.field_wrapper_attributes') >
+  <input
+       type="hidden"
+    name="{{ $field['name'] }}"
+    value="{{ old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? '' }}"
+    @include('crud::inc.field_attributes')
+       >
+</div>
\ No newline at end of file