从laravel 4中的现有表创建模型

时间:2013-07-22 17:39:49

标签: php laravel laravel-4

我目前在MySQL数据库中有一个名为app_instances的表。我正在尝试使用Laravel 4的ORM从该表中检索数据。我已经尝试创建一个简单的模型,并将数据库添加到配置中,但我收到错误。

模型/ appInst.php

class AppInst extends Eloquent
{
    protected $table = 'app_instances';
    public $timestamps = false;

}

routes.php文件

Route::get('/appInst', function()
{
    $appInst = new AppInst();
    return $appInst::all();
});

我收到错误消息class 'AppInst' not found

0 个答案:

没有答案