Skip to content

Commit

Permalink
Merge pull request #1455 from moonshine-software/fast-favicon-method
Browse files Browse the repository at this point in the history
feat: Fast favicon changer
  • Loading branch information
lee-to authored Jan 9, 2025
2 parents 4241832 + 149420f commit 37ce62b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/Laravel/src/Layouts/BaseLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@
*/
abstract class BaseLayout extends AbstractLayout
{
protected function getFaviconComponent(): Favicon
{
return Favicon::make();
}

protected function getHeadComponent(): Head
{
return Head::make([
Meta::make()->customAttributes([
'name' => 'csrf-token',
'content' => csrf_token(),
]),
Favicon::make()->bodyColor($this->getColorManager()->get('body')),
$this->getFaviconComponent()->bodyColor($this->getColorManager()->get('body')),
Assets::make(),
])
->bodyColor($this->getColorManager()->get('body'))
Expand Down Expand Up @@ -137,14 +142,14 @@ protected function getFooterCopyright(): string
{
return \sprintf(
<<<'HTML'
&copy; 2021-%d Made with ❤️ by
<a href="https://cutcode.dev"
class="font-semibold text-primary hover:text-secondary"
target="_blank"
>
CutCode
</a>
HTML,
&copy; 2021-%d Made with ❤️ by
<a href="https://cutcode.dev"
class="font-semibold text-primary hover:text-secondary"
target="_blank"
>
CutCode
</a>
HTML,
now()->year,
);
}
Expand All @@ -166,7 +171,7 @@ protected function getLogo(bool $small = false): string
$logo = $small ? 'logo-small.svg' : 'logo.svg';

return $this->getAssetManager()->getAsset(
$this->getCore()->getConfig()->getLogo($small) ?? "vendor/moonshine/$logo"
$this->getCore()->getConfig()->getLogo($small) ?? "vendor/moonshine/$logo",
);
}

Expand Down

0 comments on commit 37ce62b

Please sign in to comment.