routes.php中的致命错误异常(在windows中正常工作,在linux中混乱)

时间:2016-05-24 21:31:39

标签: php laravel-5.1

我为最后一个学期制作了这个项目,以展示高级操作系统课程的概念。在命令行上提供服务时,GUI在浏览器上可见。但是,无法在其上实现功能。点击它,我在网页上看到了这一点。 "

Whoops, looks like something went wrong.
1/1 FatalErrorException in routes.php line 27: Class 'App\Items' not found

" 。 我将代码放在我的routes.php中以供参考。

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('postitem', function () {
    return view('postitem');
});
Route::auth();

Route::get('/home', 'HomeController@index');
Route::post('/itemPosted', 'HomeController@postItem');
//Route::post('/itemPosted', 'HomeController@searchItem');
Route::get('searchItem', function () {
    $item = App\Items::all();
    $data = array(
        'items' => $item
        );
    return view('searchItem',$data);
});
Route::get('bidnow', function () {
    return view('bidnow');
});
Route::post('/bidDone', 'HomeController@bidDone');`

1 个答案:

答案 0 :(得分:0)

我在代码上尝试了很多跟踪和错误,最后最简单的工作。

我刚刚在顶部添加了use App\items;,但它确实有效。