I have got following lines:
Route::get('/dashboard', function () {
return view('main.index');
});
But my view is located in main/sub/index.blade.php
I tried
Route::get('/dashboard', function () {
return view('main.sub.index');
});
also
Route::get('/dashboard', function () {
return view('main/sub.index');
});
didnt work.
Move the view to:
resources/views/main/sub/index.blade.php
Then this code will work:
Route::get('/dashboard', function () {
return view('main.sub.index');
});
From the docs:
Views are stored in the
resources/views
directory. Since this view is stored atresources/views/greeting.blade.php
, we may return it using the globalview
helper like so:
return view('greeting', ['name' => 'James']);
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