Reputation: 31
I have a problem with laravel routing: When i use single level uri, everything is correct:
Route::get('about', 'PagesController@about');
But when i want to route two or three level uri, It shows the page like there is no CSS but in The page source the CSS assets loads correctly:
Route::get('posts/create', 'PostController@create');
I have this same problem when i use Route::resource('posts', 'PostController');
too.
Upvotes: 1
Views: 399
Reputation: 163858
You sould use absolute paths instead of relative ones. asset()
helper will help you with building correct URLs for CSS, JS and images:
<link href="{{ asset('css/styles.css') }}" rel="stylesheet">
Upvotes: 1