PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 26, 2022

[FIXED] How to link favicon icon at Laravel

 February 26, 2022     favicon, hyperlink, laravel     No comments   

Issue

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?


Solution

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') }}">


Answered By - Ahmad Sharif
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,214,943

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing