Skip to content

Commit

Permalink
Merge pull request #470 from LTKort/patch-1
Browse files Browse the repository at this point in the history
Add forceFill method to Layout class
  • Loading branch information
voidgraphics authored Jul 6, 2023
2 parents a40f885 + f4e1279 commit 063a885
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Layouts/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 063a885

Please sign in to comment.