Attempting to connect my CSS document in Laravel 4 has been a bit challenging.
The location of my CSS file is:
public/css/style.css
In the view, I have the following link:
<link type="text/css" rel="stylesheet" href="{{URL::asset('css/style.css')}}" />
Visually, the link appears correct when viewing the page source:
<link type="text/css" rel="stylesheet" href="http://localhost/css/style.css" />
However, clicking on the link results in an error page titled "Whoops! There was an error".
The error message indicates that the page does not exist. This reminds me of a similar issue I had with missing routes for other files in route.php. Do I need to create routes for all CSS/JavaScript/Images files?
There must be a simpler way to handle routing, perhaps using regex or another method?
I suspect that it might be somehow redirecting to index.php due to the virtual host configuration, which explains why the directory path differs from htdocs:
C:/Sites/localhost/public/index.php
The script filename was index.php, but the redirect URI was /css/styling.css, resulting in the same exception.
If additional information is required to assist with this issue, please do let me know. As far as I understand, this should cover the necessary details. Correct me if I'm mistaken.
Thank you for your support.