Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lrf002's avatar

Set favicon in laravel

I´d like to put a favicon to my website. I have tried doing this: <head><link rel="icon" href="{{ asset('favicon.ico') }}"></head> but it doesn´t change.

0 likes
3 replies
LaryAI's avatar
Level 58

Make sure that the favicon.ico file is located in the public directory of your Laravel project. Then, try using the asset() helper function to generate the correct URL for the favicon file. Here's an example:

<head>
    <link rel="icon" href="{{ asset('favicon.ico') }}">
</head>

If the favicon still doesn't show up, try clearing your browser cache or using a different browser.

1 like
Snapey's avatar

Just put the favicon.ico in your public folder. That's all you need to do.

Nothing in your head section unless you need to specify a different path or provide alternate sizes for different devices

1 like
arslanntariq's avatar

To update the favicon in your Laravel 10 application, follow these steps:

Navigate to the public directory: Go to the public directory of your Laravel project Locate the existing favicon file: Look for a file named favicon.ico. This is the default favicon file used by Laravel. Replace the favicon: Replace the existing favicon.ico file with your desired favicon file. Ensure that your favicon file is named favicon.ico and is in the .ico format. Example:

If your new favicon file is named logo.png, rename it to favicon.ico. Delete the old favicon.ico file and move your new favicon.ico file into the public directory

1 like

Please or to participate in this conversation.