DB facade的基础用法
// Basic statement
DB::statement('drop table users');
// Raw select, and parameter binding
DB::select('select * from contacts where validated = ?', [true]);
// Select using the fluent builder
$users = DB::table('users')->get();
// Joins and other complex calls
DB::table('users')
->join('contacts', function ($join) {
$join->on('users.id', '=', 'contacts.user_id')
->where('contacts.type', 'donor');
})->get();Last updated