PHPackages                             mouadziani/laravel-query-inspector - 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. [Database &amp; ORM](/categories/database)
4. /
5. mouadziani/laravel-query-inspector

ActiveLibrary[Database &amp; ORM](/categories/database)

mouadziani/laravel-query-inspector
==================================

The missing laravel helper that allows you to ispect your eloquent queries with their binding parameters

1.0.1(4y ago)563.9k4MITPHP

Since Jul 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/MouadZIANI/laravel-query-inspector)[ Packagist](https://packagist.org/packages/mouadziani/laravel-query-inspector)[ Docs](https://github.com/mouadziani/laravel-query-inspector)[ GitHub Sponsors](https://github.com/mouadziani)[ RSS](/packages/mouadziani-laravel-query-inspector/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Laravel Query Inspector
=======================

[](#laravel-query-inspector)

The missing laravel helper that allows you to ispect your eloquent queries with it's bind parameters

Motivations
-----------

[](#motivations)

Let's say you want to get the generated sql query from an eloquent query, by default in Laravel you can use the `toSql()` method, but in some situations you may need to get the generated query with its values instead of just getting the prepared statement, in this case you can use this package as well as a helper which will give you the generated sql query with its bind parameters as a plain sql query just by calling `toRawSql()` from any eloquent query.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mouadziani/laravel-query-inspector
```

Usage
-----

[](#usage)

```
// Using toSql()
$query = Model::where('attribute', 'value')->toSql();
dd($query); // select * from models where attribute = ?

// Using toRawSql()
$query = Model::where('attribute', 'value')->toRawSql();
dd($query); // select * from models where attribute = 'value'
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [MouadZIANI](https://github.com/mouadziani)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

featured\_repository

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1813d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d86641a10bf69b9d9820c6a5cdee8ae57f913d7406f6bb6ed8890d8cc6c15b65?d=identicon)[MouadZIANI](/maintainers/MouadZIANI)

---

Top Contributors

[![mouadziani](https://avatars.githubusercontent.com/u/29683939?v=4)](https://github.com/mouadziani "mouadziani (19 commits)")[![AminaMAHROUCH](https://avatars.githubusercontent.com/u/75863198?v=4)](https://github.com/AminaMAHROUCH "AminaMAHROUCH (1 commits)")

---

Tags

eloquentlaravelquery-builderlaravelmouadzianilaravel-query-inspector

### Embed Badge

![Health badge](/badges/mouadziani-laravel-query-inspector/health.svg)

```
[![Health](https://phpackages.com/badges/mouadziani-laravel-query-inspector/health.svg)](https://phpackages.com/packages/mouadziani-laravel-query-inspector)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M629](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M95](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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