Reputation: 135
I am trying to include files in my user page using blade syntax
@include('header')
@yield('content')
@include('footer')
here is web.php
Route::get('/', function () {
return view('layouts.user');
});
i'm getting this error
(1/1) InvalidArgumentException View [layouts.user] not found.
Upvotes: 4
Views: 13234
Reputation: 33216
You always have to use the absolute path to a view. So in your case, this should be:
@include('user.layouts.header')
@yield('content')
@include('user.layouts.footer')
The same counts for your routes file:
Route::get('/', function () {
return view('user.layouts.user');
});
Upvotes: 6
Reputation: 1279
It's because you should include full path from the view folder so it will look like this:
@include('user.layouts.header')
@include('user.layouts.footer')
Upvotes: 2