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.
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');
});
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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With