Reputation: 291
I'm new on Laravel and currently messing around the Laravel's quickstart sample project. There're list of records on tasks.blade.php, then each record will have a link to view them at tasksdetails.blade.php. I have pointed the URL via routes.php
, but it shows a failure message:-
Here's part of the associated code:-
Route::get('/taskdetails/{id}', function ($id) {
return view('tasksdetails', [
'tasksdetails' => TaskDetails::orderBy('created_at', 'asc')->get()
]);
});
So, I wonder what does that mean? Did I miss some of the crucial step? Do I need to create a related class, if so, where & how am I going to do it?
Upvotes: 2
Views: 905
Reputation: 6279
just do this,
Route::get('/taskdetails/{id}', function ($id) {
return view('tasksdetails', [
'tasksdetails' => App\TaskDetails::orderBy('created_at', 'asc')->get()
]);
});
Upvotes: 3