I am facing a pretty strange problem working with templates in Laravel. I will demonstrate it with the following example.
css/custom.css
.muted{ color:red }
Layout.blade.php
<html>
<head>
<title> HomePage </title>
<link href="css/custom.css" rel="stylesheet" />
</head>
<body>
<p>Layout file</p>
@yield('content')
</body>
</html>
subview1.blade.php
@extends('Layout')
@section('content')
<p class="muted"> From sub view 1 </p>
@stop
subview2.blade.php
@extends('Layout')
@section('content')
<p class="muted"> From subview 2 </p>
@stop
Actually what is happening is that for subview 2 the class muted is not applied. And console shows that it could not load the resource i.e custom/css when second view is loaded but works fine with subview1
Any pointers to the real issue and solution are highly appreciated.
EDIT
Attached is the directory structure. And I am referencing it like this.
1) dashboard_layout.blade.php (Layout File)
2) dashboard_index.blade.php ( subview1 )
3) course_index.blade.php (subview2)
dashboard_index.blade.php
@extends('teacher.dashboard.dashboard_layout')
course_index.blade.php
@extends('teacher.dashboard.dashboard_layout')