Skip to content

Commit

Permalink
prevent error when username is decorated and take the default name fr…
Browse files Browse the repository at this point in the history
…om setting
  • Loading branch information
AbdullahKaram-Dev committed Mar 14, 2024
1 parent 5c576dd commit c99cbb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Services/LaravelSvg.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function svgFor(string $words): self
$this->setCountWords($words);

if ($this->wordsCount < self::MINIMUM_WORDS_COUNT) {
throw new \InvalidArgumentException('Invalid words count passed to svgFor method');
$words = $this->getSetting('default_name');
}

$this->firstWord = strtoupper(Str::before($words, ' '));
Expand Down
3 changes: 2 additions & 1 deletion src/config/laravel-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
'avatar_text_color' => '#f1c40f',
'avatar_background_color' => '#ffffff',
'default_svg_path' => 'users',
'hash_svg_name' => true
'hash_svg_name' => true,
'default_name' => 'soni courses',
];

0 comments on commit c99cbb2

Please sign in to comment.