Hi destructor,
There is nothing wrong with the route, the issue is with the view. Since i do not see what you did with your view here let me put what you have said into perspective and give you what i think is going wrong.
I can see your index.blade.php is being loaded for the request. Additionally, you've said you have master template somewhere which index is extending <-- possible issue. And in you master template which index is extending, you have a ~~~ @yield('content') ~~~
Essentially one of the two things is happening
In the case above styles will not output at all since there is no reference to any styles whatsoever.
**What you views should look like**
I am assuming you main master layout is in layouts directory and obviously as you've noted above your index.blade.php is at the root.
*layouts/main.blade.php should look like this:*
<!DOCTYPE html>
<html>
<head>
title, style sheets... anything else
</head>
<body>
@yield('content')
</body>
</html>
~~~
And your index.blade.php should look like this:
@extends('layouts.main')
@section('content')
@stop
Thanks for answer sp01010011 ;) I saw that I was using @endsection instead of @stop so I chaged it but it not helped. My layouts/main.blade.php look like this:
<!DOCTYPE html>
<html>
<head>
title, style sheets... anything else
</head>
<body>
@yield('content')
</body>
</html>
My index.blade.php look like this:
@extends('layouts.main')
@section('content')
<div class="container">
Page
</div>
@stop
And style not working, what can be wrong here?
Hmm, I fixed it :) Very strange is that when I was using:
<link href="css/bootstrap.min.css" rel="stylesheet">
instead of:
{!! Html::style('css/bootstrap.min.css') !!}
style in some pages was dissapearing, but {!! Html::style('css/bootstrap.min.css') !!} fixes it.
Hi Destructor, you're most welcome.
By the way, you could use either @stop or @endsection, i always tent to go with shortest way.
As for the styles, you're absolutely right, i was thinking all you were seeing was a white page without error or data. Any who, you could also do this:
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}">
Personally, i prefer write things myself instead of having some of the code automatically generated. use the asset() method to link to public folder.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community