Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link favicon icon at Laravel

We know how to link HTML images and CSS files according to the following code.

{{ HTML::image('images/example.jpeg', 'Example Image') }} {{ HTML::style('css/main.css') }} 

But, how to link the favicon icon at Laravel as we can not do like a static HTML file?

like image 389
Ahmad Sharif Avatar asked Dec 19 '14 10:12

Ahmad Sharif


People also ask

How do I change the favicon icon in laravel?

We can link favicon icon and css file in the following way. In Laravel application put your favicon icon and css file under the public folder. In my case, I put them public/css folder.

What is favicon link tag?

A favicon is a small file containing the one or more icons which are used to represent the website or a blog. It is also known as a tab icon, website icon, URL icon, or a bookmark icon. This icon is actually displayed on the address bar, browser's tab, browser history, bookmark bar, etc.

What is http * * favicon ICO?

The favicon. ico file is a small graphic icon that is used by some browsers (including Microsoft Internet Explorer and Mozilla Firefox) to enhance the display of address bar information and "favorites" bookmark lists. When requesting a resource, these browsers also try to locate the site's custom favicon.


2 Answers

For Laravel 5.xx

We can link favicon icon and css file in the following way. In Laravel application put your favicon icon and css file under the public folder. In my case, I put them public/css folder.

<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}"> <link href="{{ asset('css/style.css') }}" rel="stylesheet"> 

For Laravel 6.00

<link rel="icon" href="{{ URL::asset('/css/favicon.jpg') }}" type="image/x-icon"/> <link rel="stylesheet" type="text/css" href="{{ URL::asset('/css/app.css')  }}"> 

For Laravel 8.00

<link rel="icon" href="{{ url('css/favicon.jpg') }}"> <link rel="stylesheet" type="text/css" href="{{ url('css/style.css') }}"> 
like image 149
Ahmad Sharif Avatar answered Sep 27 '22 23:09

Ahmad Sharif


In laravel 5, the favicon.ico is in public/favicon.ico To change the favicon, just have to replace public/favicon.ico with yours.

like image 26
s-hunter Avatar answered Sep 28 '22 01:09

s-hunter