Actualización de Laravel de la consulta
$affected = DB::table('users')
->where('id', 1)
->update(['votes' => 1]);
Alberto Peripolli
$affected = DB::table('users')
->where('id', 1)
->update(['votes' => 1]);
DB::table('user')->whereIn('id', [100,200])->get();
DB::table('user')->where('email', $userEmail)->update(array('member_type' => $plan));
$users = DB::table('users')
->where('votes', '>', 100)
->orWhere(function($query) {
$query->where('name', 'Abigail')
->where('votes', '>', 50);
})
->get();
$users = DB::table('users')
->whereIn('id', [1, 2, 3])
->get();
use Illuminate\Support\Facades\DB;
$users = DB::select('select * from users');
foreach ($users as $user) {
echo $user->name;
}