laravel fetch id from table code example Example: DB::table('users')->get(); $product = DB::table('product')->get(['id','product_name']);