简体   繁体   中英

Fatal error: Class not found Laravel on routes

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?

just do this,

Route::get('/taskdetails/{id}', function ($id) {
        return view('tasksdetails', [
        'tasksdetails' => App\TaskDetails::orderBy('created_at', 'asc')->get()
        ]);
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM