mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
set custom favicon value & render
This commit is contained in:
parent
6d6903ad62
commit
d46433c10e
2 changed files with 12 additions and 4 deletions
|
|
@ -1,2 +1,6 @@
|
|||
@if ($favicon = seo('favicon'))
|
||||
<link rel="icon" href="{{ $favicon }}">
|
||||
@else
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
|
||||
<link rel="icon" type="image/png" href="{{ asset('favicon.png') }}">
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -216,9 +216,13 @@ class SEOManager
|
|||
}
|
||||
|
||||
/** Enable favicon extension. */
|
||||
public function favicon(): static
|
||||
public function favicon(string|bool $value = true): static
|
||||
{
|
||||
$this->extensions['favicon'] = true;
|
||||
if (is_string($value) && !empty($value)) {
|
||||
$this->set('favicon', $value);
|
||||
}
|
||||
|
||||
$this->extensions['favicon'] = !!$value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue