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 yesterday

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 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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

1763d 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

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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