[英]Laravel: Route not found error
我在 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;
});
我得到: 致命錯誤:
在第 13 行的 /.../.../.../dashboard/app/routes.php 中找不到“Route”類。
我已經按照 laracast 視頻來訪問數據庫,有人可以告訴我我在這里遺漏了什么或做錯了什么嗎? 提前致謝。
可能的解決方案:
通過作曲家更新應用程序( composer update<\/code> )
<\/li>
mybe 路由緩存問題 運行命令 php artisan route:cache
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.