Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspector-apm/inspector-laravel
Code Execution Monitoring foe Laravel applications.
https://github.com/inspector-apm/inspector-laravel
inspector laravel lumen middleware monitoring
Last synced: 4 days ago
JSON representation
Code Execution Monitoring foe Laravel applications.
- Host: GitHub
- URL: https://github.com/inspector-apm/inspector-laravel
- Owner: inspector-apm
- License: mit
- Created: 2019-04-16T15:00:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-08T08:01:29.000Z (13 days ago)
- Last Synced: 2025-01-10T14:08:14.165Z (11 days ago)
- Topics: inspector, laravel, lumen, middleware, monitoring
- Language: PHP
- Homepage: https://inspector.dev
- Size: 294 KB
- Stars: 214
- Watchers: 5
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Inspector | Code Execution Monitoring Tool
[![Total Downloads](https://poser.pugx.org/inspector-apm/inspector-laravel/downloads)](//packagist.org/packages/inspector-apm/inspector-laravel)
[![Latest Stable Version](https://poser.pugx.org/inspector-apm/inspector-laravel/v/stable)](https://packagist.org/packages/inspector-apm/inspector-laravel)
[![License](https://poser.pugx.org/inspector-apm/inspector-laravel/license)](//packagist.org/packages/inspector-apm/inspector-laravel)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)> Before moving on, please consider giving us a GitHub star ⭐️. Thank you!
Code Execution Monitoring for Laravel applications.
- [Requirements](#requirements)
- [Install](#install)
- [Configure the Ingestion Key](#key)
- [Middleware](#middleware)
- [Test everything is working](#test)
- [Official Documentation](https://docs.inspector.dev/guides/laravel)
- [Contribution Guidelines](#contribution)## Requirements
- PHP >= 7.2.0
- Laravel >= 5.5## Install
Install the latest version by:
```
composer require inspector-apm/inspector-laravel
```## For Lumen
If your application is based on Lumen you need to manually register the `InspectorServiceProvider`:```php
$app->register(\Inspector\Laravel\InspectorServiceProvider::class);
```### Configure the Ingestion Key
First put the Ingestion Key in your environment file:
```
INSPECTOR_INGESTION_KEY=[ingestion key]
```You can obtain an `INSPECTOR_INGESTION_KEY` creating a new project in your [Inspector](https://inspector.dev) account.
### Attach the Middleware
To monitor HTTP requests you should attach the `WebMonitoringMiddleware` in your http application route groups.
**Laravel <= 10**
```php
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
...,
\Inspector\Laravel\Middleware\WebRequestMonitoring::class,
],'api' => [
...,
\Inspector\Laravel\Middleware\WebRequestMonitoring::class,
]
```**Laravel >= 11**
```php
use \Inspector\Laravel\Middleware\WebRequestMonitoring;return Application::configure(basePath: dirname(__DIR__))
->withMiddleware(function (Middleware $middleware) {
// Append the middleware
$middleware->appendToGroup('web', WebRequestMonitoring::class)
->appendToGroup('api', WebRequestMonitoring::class);
})
->create();
```### Test everything is working
Run the command below:
```
php artisan inspector:test
```Go to [https://app.inspector.dev](https://app.inspector.dev) to explore your data.
## Official documentation
**[Check out the official documentation](https://docs.inspector.dev/guides/laravel/installation)**
## Contributing
We encourage you to contribute to Inspector! Please check out the [Contribution Guidelines](CONTRIBUTING.md) about how to proceed. Join us!
## LICENSE
This package is licensed under the [MIT](LICENSE) license.