1$affected = DB::table('users')
2 ->where('id', 1)
3 ->update(['votes' => 1]);
1$users = DB::table('users')
2 ->where('votes', '>', 100)
3 ->orWhere(function($query) {
4 $query->where('name', 'Abigail')
5 ->where('votes', '>', 50);
6 })
7 ->get();
1 DB::table('user')->where('email', $userEmail)->update(array('member_type' => $plan));
2
1use Illuminate\Support\Facades\DB;
2
3$users = DB::select('select * from users');
4
5foreach ($users as $user) {
6 echo $user->name;
7}