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