show query laravel code example Example: show query in laravel Use the toSql() method on a QueryBuilder instance. DB::table('users')->toSql()