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?
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.
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.
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.
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') }}">
In laravel 5, the favicon.ico is in public/favicon.ico To change the favicon, just have to replace public/favicon.ico with yours.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With