For your create url you don't need the $item variable and also the method isn't needed.
Just do
Route::get('items/create', function() {
return View::make('items.create');
});
Thanks for the quick answer, but that doesn't answer my real question: Why the order of the routes in the routes.php file affects the way the project works? I think that it shouldn't matter how they are set up. If I try the URI /items/create I should go to the app/views/items/create.php file. However, changing the place the routes are in the routes file produces an error.
Yes because its looking for an {id} if you place create after the items/{id}. So thats working as expected.
juste because {id} accept "create" as argument in your route if you put this route above.. till you do not filter for exemple with a
Route::pattern( 'id', '\d+' );
or a where filter to your route,
Route::get(...)->where(array('id' => '[0-9]+' ....
order will matter! :d
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community