Example 5-15. Sample raw SQL and query builder usage
// Basic statementDB::statement('drop table users');// Raw select, and parameter bindingDB::select('select * from contacts where validated = ?', [true]);// Select using the fluent builder$users =DB::table('users')->get();// Joins and other complex callsDB::table('users')->join('contacts',function ($join) { $join->on('users.id','=','contacts.user_id')->where('contacts.type','donor'); })->get();