How to use wherein laravel code answer – 2024

In this article, we will learn how to use wherein laravel

1). laravel not in query

DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();

2). wherein laravel

DB::table('user')->whereIn('id', [100,200])->get();

3). laravel db::query update

Source: stackoverflow.com

DB::table('user')->where('email', $userEmail)->update(array('member_type' => $plan));

4). laravel wher in

$users = DB::table('users')
                    ->whereIn('id', [1, 2, 3])
                    ->get();

5). laravel DB wherein

Question::whereIn('id', $request)
            ->update(
                [
                    'status' => 1
                ]
            );

6).wherein laravel

Source: stackoverflow.com

$users = User::whereIn('id', array(1, 2, 3))->get();

Discover more from STRUGGLER KING.COM

Subscribe now to keep reading and get access to the full archive.

Continue Reading