protected $table = 'users';
}
解析
Laravel的数据操作分两种
– DB facade
– Eloquent ORM
它们除了有各自的特色外,基本的数据操作都是通过..., $second = null, $type = 'inner', $where = false)
public function joinWhere($table, $first, $operator...null, $type = 'inner', $where = false)
public function leftJoin($table, $first, $operator = null, $second...= null)
public function where($column, $operator = null, $value = null, $boolean = 'and')
public function...ORM
Eloquent ORM 与DB facade 类似,首先每个 Eloquent ORM 都需要继承父类 Illuminate\Database\Eloquent\Model
你大概会这样写