Laravel Route failing: Receiving PHP Fatal error: Class 'Route' not found in routes.php on line 14

断了今生、忘了曾经 提交于 2019-12-08 08:10:13

问题


I am getting the following error when trying to display my site:

PHP Fatal error: Class 'Route' not found in /home/jillumin/public_html/muse/app/routes.php on line 14

Route looks like the following:

Route::resource('ideas','IdeaController');

The controller is here:

class Idea_Controller extends BaseController {

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
       //get all the ideas
       $ideas =  idea::all();

       // load the view and pass the ideas
        return View::make('muse.index');

    } 
}

Any ideas?


回答1:


You've either name-spaced your routes.php file or disabled the alias in config/app.php for Route. You could also try running 'composer dump' to rebuild Composers autoload_classmap.php.



来源:https://stackoverflow.com/questions/23743889/laravel-route-failing-receiving-php-fatal-error-class-route-not-found-in-rou

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!