Skip to content

Commit

Permalink
fix usage IconComponent render function (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Верхотурова Анастасия <[email protected]>
  • Loading branch information
owlana and Верхотурова Анастасия authored Jul 20, 2024
1 parent b2fc5c8 commit ba24f6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IconComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public function __construct(
*/
public function render(): callable
{
return function (array $data) {
return function (array $data = []) {
return view('blade-icon::icon', [
'html' => $this->finder->loadFile($this->path),
'data' => collect($this->extractPublicProperties())->merge($data['attributes'])->filter(fn($value) => is_string($value)),
'data' => collect($this->extractPublicProperties())->merge($data['attributes'] ?? [])->filter(fn($value) => is_string($value)),
]);
};
}
Expand Down

0 comments on commit ba24f6c

Please sign in to comment.