标签:
5里面直接artisan建立model
./artisan make:model MyModel
找到MyModel,改成下面这样
<?php namespace App; use Illuminate\Database\Eloquent\Model; class MyModel extends Model { //添加这两个,最下面的,因为我是手工建表 protected $table = ‘app_versions‘; public $timestamps = false; }
测试代码
Route::get(‘/‘, function() { $data = \App\MyModel::all(); return $data; });
标签:
原文地址:http://www.cnblogs.com/ziyouchutuwenwu/p/4274118.html