diff --git a/src/Layouts/Layout.php b/src/Layouts/Layout.php index e8ab597b..4195af8c 100644 --- a/src/Layouts/Layout.php +++ b/src/Layouts/Layout.php @@ -387,6 +387,22 @@ public function fill(ScopedRequest $request) ->all(); } + /** + * Force Fill the layout with an array of attributes. + * + * @param array $attributes + * @return $this + */ + public function forceFill(array $attributes) + { + foreach ($attributes as $key => $value) { + $attribute = Str::replace('->', '.', $key); + Arr::set($this->attributes, $attribute, $value); + } + + return $this; + } + /** * Get validation rules for fields concerned by given request *