PHPackages                             bethinkpl/elastic-apm-laravel - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. bethinkpl/elastic-apm-laravel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

bethinkpl/elastic-apm-laravel
=============================

A package to integrate Elastic APM 7.x into Laravel

7.6.0(5y ago)129.3k1MITPHPPHP &gt;= 7.2

Since Jun 19Pushed 5y agoCompare

[ Source](https://github.com/bethinkpl/elastic-apm-laravel)[ Packagist](https://packagist.org/packages/bethinkpl/elastic-apm-laravel)[ RSS](/packages/bethinkpl-elastic-apm-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (9)Versions (35)Used By (0)

PHP Elastic APM for Laravel &amp; Lumen
=======================================

[](#php-elastic-apm-for-laravel--lumen)

Laravel package of the  library, automatically handling transactions and errors/exceptions. If using `Illuminate\Support\Facades\Auth` the user Id added to the context. Tested with Laravel `6.*` and the philkra/elastic-apm-php-agent version `7.x`.

[Install](https://packagist.org/packages/bethinkpl/elastic-apm-laravel)
-----------------------------------------------------------------------

[](#install)

```
composer require bethinkpl/elastic-apm-laravel

```

Use local code in wnl-platform instead of a released package
------------------------------------------------------------

[](#use-local-code-in-wnl-platform-instead-of-a-released-package)

```
cd wnl-platform/vendor/bethinkpl/
rm -rf elastic-apm-laravel
ln -s ../../../elastic-apm-laravel ./elastic-apm-laravel

```

Make sure to use absolute paths.

Additional features
-------------------

[](#additional-features)

- `X-Requested-By` HTTP request header value is set as `labels.requested_by` APM transaction field (`end-user-ajax` value is used when `X-Requested-With: XMLHttpRequest` is set)
- sampling of transactions reported to APM
- tracking of HTTP requests performed using GuzzleHttp library. Simply add the following middleware to your Guzzle client:

```
