laravel select id from table where where condition code example Example: DB::table('users')->get(); id 1 $users = DB::table('users')where('id','=', $userid)->get();