I'm trying to display a View having the following codes:
{!! Stored in /resources/views/about.blade.php !!}
@extends('layouts.app')
@section('title')
Conway's Game Of Life - About
@endsection
@section('content')
<h2>Conway's Game Of Life - About</h2>
<p>The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.</p>
@endsection
Then the following main blade page:<!-- Stored in /resources/views/layouts/app.blade.php --> <title>@yield('title')</title>
@yield('content')
After this a routes.php comes:
Route::get('/', function () {
return view('index');
});
Route::get('/about/', function () {
return view('about');
});
Route::get('/about/', 'HomeController@About');
I get the following errors:
`InvalidArgumentException in FileViewFinder.php line 137:
View [index.blade] not found.ErrorException in FileViewFinder.php line 137:
View [index.blade] not found. (View: C:\Bitnami\wampstack-5.5.30-0\apache2\htdocs\GameOfLifeesources\views\layouts\app.blade.php)ErrorException in FileViewFinder.php line 137:
View [index.blade] not found. (View: C:\Bitnami\wampstack-5.5.30-0\apache2\htdocs\GameOfLifeesources\views\layouts\app.blade.php) (View: C:\Bitnami\wampstack-5.5.30-0\apache2\htdocs\GameOfLifeesources\views\layouts\app.blade.php)`
What shall I do better to avoid having errors?
Thanks for helping me out of trouble!
PS, Suggestion:
Neither of the answers below find a solution to the problem. Can this be that I use PHP7, not any lesser version? It might influence the execution of Laravel program codes.
You have view called about.blade.php but you are missing view called index.blade.php which is expected since you defined that route
Route::get('/', function () {
return view('index');
});
Also since you are using layout templates, on top of all your views you must specify which view are you extending with @extend
Firs of all make sure that under layouts
folder app.blade.php
exists and it has these two statements @yield('content')
inside body and @yield('title')
between head
tags.
Do one of these not both
Route::get('about', function () {
return view('about');
});
OR
Route::get('about', 'HomeController@About');
And make sure that your index.blade.php
exists under views
If you still get error please comment.