Php Laravel:找不到路由错误
我在拉威尔有个新手问题。我正在尝试查询数据库。我已经修改了配置,为我的数据库添加了必要的凭据。现在,当我尝试像这样查询我的数据库时:Php Laravel:找不到路由错误,php,mysql,database,laravel-4,Php,Mysql,Database,Laravel 4,我在拉威尔有个新手问题。我正在尝试查询数据库。我已经修改了配置,为我的数据库添加了必要的凭据。现在,当我尝试像这样查询我的数据库时: <?php /* |-------------------------------------------------------------------------- | Application Routes |--------------------------------------------------------------------
<?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;
});
可能的解决方案:
按编写器更新应用程序(composer Update
)
检查文件权限
你给你的应用命名了吗?试试\Route::get()
,就像我提到的,我在这里真的是个新手。在这种情况下,名称空间是什么意思?我应该把这个\Route::get()放在哪里?将您的代码从Route::get(
更改为\Route::get(
尝试过了。问题仍然存在。能否显示routesDB.php
文件的顶部和第三行?