Reputation: 8368
I'm currently learning Laravel, very new to it.
I have two routes setup like so:
Route::get('/', function () {
return view('welcome');
});
Route::get('/about', function () {
return view('pages.about');
});
In the 'pages.about' file I've inputted an <h1>
with some random text to test it, however, when I navigate to that page in localhost all I get is a white page with the number '2' displayed. No errors, just '2':
Any ideas as to why this is happening?
File-tree if needed:
EDIT
about.blade.php:
kjnksjndkjnsdc
<h1>ijsoijsoijs</h1>
Upvotes: 2
Views: 813
Reputation: 8368
Not sure what the problem was but I reset the project from scratch and it's now working. Luckily, I wasn't too far in to delete the entire project.
Upvotes: 0
Reputation: 113
Try to execute command php artisan view:clear and php artisan route:clear
Upvotes: 2
Reputation: 11
Route is ok. Folder structure is ok too. Is this a blank project? Did you change someting in some other folders?
Because I try this on my PC and works fine
Upvotes: 1
Reputation: 3
instead of return view just echo something like
Route::get('/about', function () {
//return view('pages.about');
echo "laravel";
});
check it again using ctrl+f5 key if there any cache issue is same result show then change the method from get to post again try it if it shows properly the echo then go to your about page and give the proper html structure
Upvotes: 1