PHPackages                             byancode/eloquent-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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. byancode/eloquent-raw-sql

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

byancode/eloquent-raw-sql
=========================

Print raw sql from eloquent.

014PHP

Since Aug 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/byancode/eloquent-raw-sql)[ Packagist](https://packagist.org/packages/byancode/eloquent-raw-sql)[ RSS](/packages/byancode-eloquent-raw-sql/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Eloquent Raw Sql
================

[](#eloquent-raw-sql)

laravel model eloquent to raw sql

Getting Started
---------------

[](#getting-started)

### 1. Install

[](#1-install)

Run the following command:

```
composer require byancode/eloquent-raw-sql
```

```
Byancode\EloquentRawSql\Provider::class,
```

### 2. Publish

[](#2-publish)

Publish config file.

```
php artisan vendor:publish --provider="Byancode\EloquentRawSql\Provider"
```

### 3. Example

[](#3-example)

```
App\User::where('id', 41545)->orderBy('id', 'desc')->toRawSql();
# output: select * from `users` where `users`.`id` = 41545 order by `users`.`id` DESC
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37272486?v=4)[Byancode](/maintainers/byancode)[@byancode](https://github.com/byancode)

---

Top Contributors

[![byancode](https://avatars.githubusercontent.com/u/37272486?v=4)](https://github.com/byancode "byancode (4 commits)")

### Embed Badge

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

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

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.6k](/packages/spatie-craft-ray)

PHPackages © 2026

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