We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f700a28 + 80c2744 commit fa681edCopy full SHA for fa681ed
src/Layouts/Layout.php
@@ -6,6 +6,8 @@
6
use Exception;
7
use ArrayAccess;
8
use JsonSerializable;
9
+use Illuminate\Support\Arr;
10
+use Illuminate\Support\Str;
11
use Laravel\Nova\Fields\Field;
12
use Laravel\Nova\Fields\Heading;
13
use Illuminate\Database\Eloquent\Model;
@@ -846,4 +848,22 @@ public function toArray()
846
848
{
847
849
return $this->attributesToArray();
850
}
851
+
852
853
+ /**
854
+ * Fill the model with an array of attributes.
855
+ *
856
+ * @param array $attributes
857
+ * @return $this
858
+ */
859
+ public function forceFill(array $attributes)
860
+ {
861
+ foreach ($attributes as $key => $value) {
862
+ $attribute = Str::replace('->', '.', $key);
863
864
+ Arr::set($this->attributes, $attribute, $value);
865
+ }
866
867
+ return $this;
868
869
0 commit comments