Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Laravel Controllers Controller Overview

Larry Joiner
Larry Joiner
1,091 Points

View [todos.index] not found

I have used the following code in my routes.php file which produces the "View [todos.index] not found" error. The index.blade.php file DOES exist in the \laravel-basics\resources\views\layouts\todos directory. Any idea(s) what is causing the error?

Route::get('/', function() { return View::make('todos.index'); });

Route::get('/todos', function() { return View::make('todos.index'); });

Route::get('/todos/{id}', function($id) { return View::make('todos.show')->withId($id); });

1 Answer

Larry Joiner
Larry Joiner
1,091 Points

Answer found!

I had to add the complete routing...

Route::get('/', function() { return View::make('layouts.todos.index'); });

Route::get('layouts/todos', function() { return View::make('layouts.todos.index'); });

Route::get('layouts/todos/{id}', function($id) { return View::make('layouts.todos.show')->withId($id); });