Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Retrieve fonts from the manifest when Webfonts is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 28, 2024
1 parent d3423ba commit 4f6c339
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Webfonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ class Webfonts

/**
* Create a new Webfonts instance.
*
* @return void
*/
public function __construct()
{
$this->fonts = $this->fonts();
$this->preload = PreloadWebfonts::make($this);
}

Expand Down Expand Up @@ -56,7 +55,7 @@ public function fonts(): array
return $this->fonts;
}

return $this->fonts = collect($this->manifest())
return collect($this->manifest())
->filter(fn ($value, $key) => Str::endsWith($key, '.woff2'))
->toArray();
}
Expand Down

0 comments on commit 4f6c339

Please sign in to comment.