$table = 'users';
}
解析
Laravel的数据操作分两种
DB facade
Eloquent ORM
它们除了有各自的特色外,基本的数据操作都是通过 Illuminate\Database...from($table)
public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where...')
public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where...= false)
public function leftJoin($table, $first, $operator = null, $second = null)
public function where...Eloquent ORM
Eloquent ORM 与DB facade 类似,首先每个 Eloquent ORM 都需要继承父类 Illuminate\Database\Eloquent\Model