laravel run db query code example
Example 1: laravel db query
$users = DB::table('users')
->where('votes', '>', 100)
->orWhere(function($query) {
$query->where('name', 'Abigail')
->where('votes', '>', 50);
})
->get();
Example 2: DB: in eloquent using sql
$results = DB::select('select * from users where id = :id', ['id' => 1]);