Laravel URL issue

255 views Asked by At

In my source code of Blade file of CSS include URL is like below

<link rel="stylesheet" href="{{ asset('frontend/css/bootstrap.min.css') }}" type="text/css">

But I am getting below URL in page source of browser

<link rel="stylesheet" href="http://127.0.0.1:8000/public/frontend/css/bootstrap.min.css" type="text/css">

Why I am getting this ? How can I remove public from the URL ?

2

There are 2 answers

2
Bharat Rawat On

asset() function points to the public folder. For your css file to work make a 'frontend' folder in the public directory

11
N69S On

You're getting public in the path because you're accessing your site the same way http://127.0.0.1:8000/public/.

You need to change how your server serves the application.