Download the PHP package eta/laravel-query-watcher without Composer

On this page you can find all versions of the php package eta/laravel-query-watcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-query-watcher

Laravel Query Watcher

A Laravel package to monitor and log database queries with configurable thresholds and detailed performance metrics.

Features

Installation

Install the package via Composer:

Laravel Auto-Discovery

The package will automatically register its service provider in Laravel 5.5+.

Manual Registration (Laravel 5.4 and below)

Add the service provider to config/app.php:

Configuration

Publish the configuration file:

This will create config/query-watcher.php with the following options:

Main Configuration Options

QUERY_WATCHER_SLOW_QUERY_ENABLED=false

Slow query threshold (milliseconds)

QUERY_WATCHER_SLOW_QUERY_THRESHOLD=1000

Log query details (SQL and bindings)

QUERY_WATCHER_LOG_DETAILS=false

Custom log channel

QUERY_WATCHER_LOG_CHANNEL=stack

[2024-01-15 10:30:45] local.WARNING: [QueryWatcher] High number of DB queries detected on api/users: 75 queries (threshold: 50) { "path": "api/users", "query_count": 75, "threshold": 50, "slow_queries_count": 3 }

[2024-01-15 10:30:45] local.WARNING: [QueryWatcher] Slow query detected on api/users: 1250.50ms { "path": "api/users", "execution_time_ms": 1250.50 } env QUERY_WATCHER_LOG_CHANNEL=query-watcher



### Excluding Specific Paths

In `config/query-watcher.php`:

### Excluding Artisan Commands

In `config/query-watcher.php`:

## Best Practices

1. **Sensitive Data**: Be cautious when enabling `log_query_details` as it may expose sensitive data in logs
2. **Production**: Consider disabling in production by setting `QUERY_WATCHER_ENABLED=false` or using a separate log channel
3. **Thresholds**: Adjust thresholds based on your application's normal query patterns
4. **Exclusions**: Exclude admin panels, debug tools, and high-traffic endpoints that you're aware of

## Requirements

- PHP 7.2 or higher
- Laravel 5.8, 6.x, 7.x, 8.x, 9.x, 10.x, or 11.x

## License

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

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Credits

- [HaiHV](https://github.com/ethantechnology)

## Support

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

All versions of laravel-query-watcher with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1|^8.2|^8.3
illuminate/support Version ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/database Version ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eta/laravel-query-watcher contains the following files

Loading the files please wait ...