Answers for "laravel db where condition"

PHP
1

where clause in laravel

$users = DB::table('user')->select('id', 'name', 'email','api_token','created_at')->where('email' , $email)->get();
        return response()->json($users);
Posted by: Guest on December-02-2021
0

DB raw with where condition in laravwel

$someVariable = Input::get("some_variable");

$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = '$someVariable'") );
Posted by: Guest on October-26-2020

Browse Popular Code Answers by Language