-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize admin favicon using admin.icon_image setting #4051
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case a one line solution might be enough:
-<link rel="shortcut icon" href="{{ voyager_asset('images/logo-icon.png') }}" type="image/x-icon">
+<link rel="shortcut icon" href="{{ Voyager::setting('admin.icon_image') ? Voyager::image(Voyager::setting('admin.icon_image')) : voyager_asset('images/logo-icon.png') }}" type="image/x-icon">
But if you want to keep the if else for clarity, to not repeat html, I would do something like this:
@php
if (Voyager::setting('admin.icon_image')) {
$admin_favicon = Voyager::image(Voyager::setting('admin.icon_image'));
} else {
$admin_favicon = voyager_asset('images/logo-icon.png');
}
@endphp
<link rel="shortcut icon" href="{{ $admin_favicon }}" type="image/x-icon">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olegtsoy I saw about your choice for code styling, it makes sense.
Works for me.
I'm not a hundred percent sure that this is compatible with |
According to https://en.wikipedia.org/wiki/Favicon PNG and ICO are supported on all modern browsers, including IE11. |
Its more about |
Adding possibility to change favicon using admin.icon_image setting