Skip to content

Commit

Permalink
Add forceFill method to Layout class
Browse files Browse the repository at this point in the history
  • Loading branch information
LTKort authored Jul 6, 2023
1 parent a40f885 commit f4e1279
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 f4e1279

Please sign in to comment.