PHPackages                             scoutapp/scout-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. scoutapp/scout-apm-laravel

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

scoutapp/scout-apm-laravel
==========================

Scout Application Performance Monitoring Agent - https://scoutapm.com

2.5.0(1y ago)23831.3k↓28.4%15[2 issues](https://github.com/scoutapp/scout-apm-laravel/issues)MIT

Since Aug 6Pushed 1y ago5 watchersCompare

[ Source](https://github.com/scoutapp/scout-apm-laravel)[ Packagist](https://packagist.org/packages/scoutapp/scout-apm-laravel)[ Docs](https://scoutapm.com/)[ RSS](/packages/scoutapp-scout-apm-laravel/feed)WikiDiscussions 2.6.x Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (31)Used By (0)

Scout Laravel APM Agent
=======================

[](#scout-laravel-apm-agent)

Monitor the performance of PHP Laravel applications with Scout's PHP APM Agent. Detailed performance metrics and transaction traces are collected once the scout-apm package is installed and configured.

Requirements
------------

[](#requirements)

- PHP Version: PHP 7.2+ (PHP 8.3+ recommended)
- Laravel Version: 5.5+

Quick Start
-----------

[](#quick-start)

A Scout account is required. [Signup for Scout](https://scoutapm.com/users/sign_up).

```
composer require scoutapp/scout-apm-laravel
```

Then use Laravel's `artisan vendor:publish` to ensure configuration can be cached:

```
php artisan vendor:publish --provider="Scoutapm\Laravel\Providers\ScoutApmServiceProvider"
```

### Configuration

[](#configuration)

In your `.env` file, make sure you set a few configuration variables:

```
SCOUT_KEY=ABC0ZABCDEFGHIJKLMNOP
SCOUT_NAME="My Laravel App"
SCOUT_MONITOR=true

```

Your key can be found in the [Scout organization settings page](https://scoutapm.com/settings).

#### Logging Verbosity

[](#logging-verbosity)

Once you have set up Scout and are happy everything is working, you can reduce the verbosity of the library's logging system. The library is intentionally *very* noisy by default, which gives us more information to support our customers if something is broken. However, if everything is working as expected, these logs can be reduced by setting the `log_level` configuration key to a higher `Psr\Log\LogLevel`. For example, if you are using `.env` configuration:

```
SCOUT_LOG_LEVEL=error

```

Or if you are using `config/scout_apm.php`:

```
$config[\Scoutapm\Config\ConfigKey::LOG_LEVEL] = \Psr\Log\LogLevel::ERROR;
```

Any of the constants defined in `\Psr\Log\LogLevel` are acceptable values for this configuration option.

### Laravel 11 Error Handling

[](#laravel-11-error-handling)

In Laravel 11, the `App\Exceptions\Handler` approach has been retired, and a new method `withExceptions()` has been added in `bootstrap/app.php` when configuring the application. In order for Scout APM Error Handling to pick up uncaught exceptions, you should add the appropriate Scout APM call, for example:

```
return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        // ...
    })
    ->withExceptions(function (Exceptions $exceptions) {
        // Add the following call to enable uncaught exceptions in Scout APM error reporting:
        $exceptions->reportable(function (Throwable $e) {
            app()->make(\Scoutapm\ScoutApmAgent::class)->recordThrowable($e);
        });
    })->create();
```

Documentation
-------------

[](#documentation)

For full installation and troubleshooting documentation, visit our [help site](https://docs.scoutapm.com/#laravel).

Support
-------

[](#support)

Please contact us at  or create an issue in this repo.

Capabilities
------------

[](#capabilities)

The Laravel library:

- Registers a service `\Scoutapm\ScoutApmAgent::class` into the container (useful for dependency injection)
- Provides a Facade `\Scoutapm\Laravel\Facades\ScoutApm`
- Wraps view engines to monitor view rendering times
- Injects several middleware for monitoring controllers and sending statistics to the Scout Core Agent
- Adds a listener to the database connection to instrument SQL queries

Custom Instrumentation
----------------------

[](#custom-instrumentation)

In order to perform custom instrumentation, you can wrap your code in a call to the `instrument` method. For example, given some code to be monitored:

```
$request = new ServiceRequest();
$request->setApiVersion($version);
```

Using the provided Facade for Laravel, you can wrap the call and it will be monitored.

```
// At top, with other imports
use Scoutapm\Events\Span\Span;
use Scoutapm\Laravel\Facades\ScoutApm;

// Replacing the above code
$request = ScoutApm::instrument(
    'Custom',
    'Building Service Request',
    static function (Span $span) use ($version) {
        $request = new ServiceRequest();
        $request->setApiVersion($version);
        return $request;
    }
);
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 87.1% 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 ~63 days

Recently: every ~46 days

Total

29

Last Release

707d ago

Major Versions

v0.2.3 → v1.0.02019-12-04

v1.8.0 → v2.0.02021-02-23

PHP version history (3 changes)v0.1.0PHP &gt;= 7.0

v0.2.1PHP &gt;= 7.1

v1.1.0PHP &gt;=7.1.0,&lt;7.5.0

### Community

Maintainers

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

---

Top Contributors

[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (162 commits)")[![lancepioch](https://avatars.githubusercontent.com/u/1296882?v=4)](https://github.com/lancepioch "lancepioch (17 commits)")[![arcdigital](https://avatars.githubusercontent.com/u/551002?v=4)](https://github.com/arcdigital "arcdigital (2 commits)")[![devingray](https://avatars.githubusercontent.com/u/11573528?v=4)](https://github.com/devingray "devingray (1 commits)")[![fabiofdsantos](https://avatars.githubusercontent.com/u/8303937?v=4)](https://github.com/fabiofdsantos "fabiofdsantos (1 commits)")[![hussam-almarzoq](https://avatars.githubusercontent.com/u/15607673?v=4)](https://github.com/hussam-almarzoq "hussam-almarzoq (1 commits)")[![imhmdb](https://avatars.githubusercontent.com/u/34659256?v=4)](https://github.com/imhmdb "imhmdb (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelmonitoringperformanceapmdevelopment

### Embed Badge

![Health badge](/badges/scoutapp-scout-apm-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/scoutapp-scout-apm-laravel/health.svg)](https://phpackages.com/packages/scoutapp-scout-apm-laravel)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[jackwh/laravel-new-relic

Monitor your Laravel application performance with New Relic

112827.2k](/packages/jackwh-laravel-new-relic)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)

PHPackages © 2026

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