2014-11-03 94 views
2

我在laravel有一個新手問題。我試圖查詢一個數據庫。我已經修改了配置以包含我的數據庫所需的憑據。現在,當我嘗試查詢我的數據庫是這樣的:Laravel:路由未找到錯誤

<?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 Closure to execute when that URI is requested. 
| 
*/ 
Route::get('/', function() 
{ 
    $topPages = DB::table('webmasters') -> get(); 
    return $topPages; 
}); 

我得到:致命錯誤:

Class 'Route' not found in /.../.../.../dashboard/app/routes.php on line 13.

我按照laracast視頻訪問數據庫的信,可有人請告訴我我在這裏失蹤或做錯了什麼? 在此先感謝。

+1

你有沒有命名空間您的應用程序?嘗試'\ Route :: get()' – Laurence 2014-11-03 09:29:22

+0

就像我提到的,我在這裏真的很綠。命名空間在這種情況下意味着什麼?我在哪裏把這個\ Route :: get() – 2014-11-03 09:32:02

+0

從'Route :: get('到'\ Route :: get(' – Laurence 2014-11-03 09:32:45

回答

1

可能的解決方案:

  1. 更新的應用程序由作曲家(composer update
  2. 檢查文件權限