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

sina29's avatar
Level 1

Set a favicon

I've been trying to set a favicon in my Laravel project, which uses Vite to compile frontend assets. I followed this approach:

"Just placed the favicon.ico in the public folder, without adding anything to the head section unless a different path or alternate sizes are needed."

I deleted the default favicon, replaced it with my own, and renamed it favicon.ico, didn't add anything to head section. But it's still not showing. Could you help me find a solution?

0 likes
2 replies
Sinnbeck's avatar

Try setting it in your layout. Add this inside the head tag

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
1 like
Snapey's avatar

This wont work if your document root is wrong, eg, if you see public as part of your URL's

Please or to participate in this conversation.