PHPackages                             f-liva/eloquent-to-raw-sql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. f-liva/eloquent-to-raw-sql

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

f-liva/eloquent-to-raw-sql
==========================

Exposes the eloquent toRawSql method to display the raw query in beautified form.

1.0.2(1y ago)0221MITPHP

Since Nov 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/f-liva/eloquent-to-raw-sql)[ Packagist](https://packagist.org/packages/f-liva/eloquent-to-raw-sql)[ Docs](https://github.com/f-liva/eloquent-to-raw-sql)[ RSS](/packages/f-liva-eloquent-to-raw-sql/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Eloquent toRawSql
=================

[](#eloquent-torawsql)

Exposes the eloquent toRawSql method to display the raw query in beautified form.

Install
-------

[](#install)

`composer require f-liva/eloquent-to-raw-sql`

Use
---

[](#use)

```
$products = Product
    ::where('availability', 'available')
    ->where('type', 'goods')
    ->groupBy('category')
    ->orderByDesc('price')
    ->limit(10);

dump($products->toRawSql()); // Beautified SQL (as default)

//    SELECT
//        *
//    FROM
//        `products`
//    WHERE
//        `products`.`availability` = 'available'
//         AND `products`.`type` = 'goods'
//    GROUP BY
//        `products`.`category`
//    ORDER BY
//        `products`.`price` DESC
//    LIMIT 10;

dump($products->toRawSql(false)); // Unbeautified SQL

//  SELECT * FROM `products` WHERE `products`.`availability` ...
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

589d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/346224?v=4)[Federico Liva](/maintainers/f-liva)[@f-liva](https://github.com/f-liva)

---

Tags

laravelto-raw-sqleloquent-to-raw-sql

### Embed Badge

![Health badge](/badges/f-liva-eloquent-to-raw-sql/health.svg)

```
[![Health](https://phpackages.com/badges/f-liva-eloquent-to-raw-sql/health.svg)](https://phpackages.com/packages/f-liva-eloquent-to-raw-sql)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
