PHPackages                             larawatcher/larawatcher - 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. larawatcher/larawatcher

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

larawatcher/larawatcher
=======================

Larawatcher: Laravel Database Query Profiler

0.1.4(5y ago)10498.6k↓55.2%[2 PRs](https://github.com/larawatcher/larawatcher/pulls)MITPHPPHP ^7.4|^8.0

Since Feb 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/larawatcher/larawatcher)[ Packagist](https://packagist.org/packages/larawatcher/larawatcher)[ Docs](https://larawatcher.com)[ RSS](/packages/larawatcher-larawatcher/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (8)Versions (8)Used By (0)

[![](./images/logo.svg)](./images/logo.svg)Larawatcher
===========

[](#larawatcher)

[![PHP Version](https://camo.githubusercontent.com/aa500da1ed1b774ca7d96b051d6ac8ef447620d01600eb593f963582103e0f0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c617261776174636865722f6c61726177617463686572)](https://packagist.org/packages/larawatcher/larawatcher)[![Latest Version on Packagist](https://camo.githubusercontent.com/fc6c9a91552afcf24dc334cd6e6ca8290d94101ac6e23c9c95f4e8a8b8d7da93/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617261776174636865722f6c61726177617463686572)](https://packagist.org/packages/larawatcher/larawatcher)[![GitHub Tests Action Status](https://camo.githubusercontent.com/151c7ae104bcbd690475d968c6e03fc4bc4a4715787a5406d9ca597490c48d9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c617261776174636865722f6c617261776174636865722f5465737473)](https://github.com/larawatcher/larawatcher/actions?query=workflow%3ATests+branch%3Amaster)[![License](https://camo.githubusercontent.com/384452ff8a4f570a4b2a3a02a6459d421be677ae24ac856acb95bcdf65199de2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c617261776174636865722f6c61726177617463686572)](https://packagist.org/packages/larawatcher/larawatcher)

Larawatcher is a combination of Laravel Package and a stand alone desktop application that lets you profile database queries, find N+1 issues, backtrace to the code and more.

Desktop Application
-------------------

[](#desktop-application)

[![](./images/screenshot.png)](./images/screenshot.png)

Larawatcher comes with a stand-alone application that receives requests from your application, saves them and provides you with a dashboard to work with it.

You can download the latest version of the `Larawatcher Desktop` from .

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

[](#installation)

You can install the package via composer:

```
composer require --dev larawatcher/larawatcher
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Larawatcher\Providers\LarawatcherServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    /*
     * Use this setting if you want to disable/enable Larawatcher to listen for query execution
     */
    'enabled' => env('LARAWATCHER_ENABLED', true),
    /*
     * The `endpoint` will be used to send requests to Larawatcher desktop app.
     * `localhost` is good if you are using something like Laravel valet.
     * For Docker you may use `host.docker.internal` and for Laravel Homestead you may use `10.0.2.2`.
     */
    'endpoint' => env('LARAWATCHER_ENDPOINT', 'localhost'),
    /*
     * The `port` number used together with `endpoint` to send requests to Larawatcher desktop app.
     * The port should match the port you defined in Larawatcher desktop app (default 3000)
     */
    'port' => env('LARAWATCHER_PORT', 3000),
    /*
     * If you need Larawatcher to report queries wrapped between tags only, you may set `tags_only`
     * to `true`.
     */
    'tags_only' => env('LARAWATCHER_TAGS_ONLY', false),
    /**
     * If you need Larawatcher run `EXPLAIN` against the queries, set `explain` to `true`.
     */
    'explain' => env('LARAWATCHER_EXPLAIN', false),
    /**
     * In order to use `Open in editor` feature on desktop app and better backtrace, Larawatcher needs to know
     * where on your machine the code lives. If you are using Laravel valet, you may leave this blank and it will
     * figure it out, however in case of Docker or Laravel Homestead you need to be explicit about the path.
     */
    'app_path' => null,
    /**
     * This setting will be used to define the route groups that Larawatcher needs to watch for query execution.
     */
    'middleware_groups' => env('LARAWATCHER_MIDDLEWARE_GROUPS', ['web', 'api']),
];
```

How does it work?
-----------------

[](#how-does-it-work)

Larawatcher will listen to events related to `routes`, `commands` and `jobs` (including asynchronous ones), then it will watch the queries and communicate them back to the desktop app. Please note the entry point to the application will invoke the watcher, and it won't be two separate processes (except the async jobs). For example: if you have a route that will run an artisan command and fire off a sync job, all queries will be captures in the `route` process.

How to use tags?
----------------

[](#how-to-use-tags)

To leverage the tag feature on Larawatcher, you may tag and untag part of your code using the Larawatcher facade or the helper functions. Facade Example::

```
Larawatcher::tag('load-users');

$users = User::all();

Larawatcher::untag('load-users');
```

Helper functions example:

```
lw_tag('load-users');

$users = User::all();

lw_untag('load-users');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Hugh Saffar](https://github.com/hughsaffar)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

5

Last Release

1976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f1c99f95f05f0fa52ddbc5f599729ad3c9f7273e6678d622de4c79c12cb9b2f?d=identicon)[hughsaffar](/maintainers/hughsaffar)

---

Top Contributors

[![hughsaffar](https://avatars.githubusercontent.com/u/10440022?v=4)](https://github.com/hughsaffar "hughsaffar (18 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

laraveldb-profiler

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/larawatcher-larawatcher/health.svg)

```
[![Health](https://phpackages.com/badges/larawatcher-larawatcher/health.svg)](https://phpackages.com/packages/larawatcher-larawatcher)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)

PHPackages © 2026

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