PHPackages                             yesdevs/laravel-application-insights - 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. yesdevs/laravel-application-insights

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

yesdevs/laravel-application-insights
====================================

A Laravel 11/12/13 package to send application insights to Microsoft Application Insights

1.0.4(1mo ago)0541MITPHPPHP ^8.2

Since Oct 15Pushed 1mo agoCompare

[ Source](https://github.com/yesdevs/laravel-azure-application-insights)[ Packagist](https://packagist.org/packages/yesdevs/laravel-application-insights)[ Docs](https://github.com/Yesdevs/laravel-application-insights)[ RSS](/packages/yesdevs-laravel-application-insights/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (12)Versions (6)Used By (0)

Application Insights for Laravel
================================

[](#application-insights-for-laravel)

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

[](#installation)

Add the following to your *composer.json* file:

```
"repositories": [
    {
      "type": "git",
      "url": "https://github.com/mondago/ApplicationInsights-PHP"
    },
    {
        "type": "git",
        "url": "https://github.com/yesdevs/laravel-azure-application-insights"
    }
],
```

and require it by adding the following line to your *composer.json* file under "require":

```
"yesdevs/laravel-application-insights": "^1.0.0"

```

Optionally, you can publish the config file of this package with this command:

```
php artisan vendor:publish --provider="Yesdevs\ApplicationInsights\ServiceProvider"
```

Middleware
----------

[](#middleware)

As a convenience you may choose to use the `Yesdevs\ApplicationInsights\Middleware\TrackRequest` middleware which will send the request and response to Application Insights. The middleware utilizes [terminable middleware](https://laravel.com/docs/8.x/middleware#terminable-middleware) from Laravel to ensure that tracking the request doesn't block the response being sent.

Since 0.6.2, if the request has a session started, this middleware will set the session id as the anonymous user id to allow tracking of user flows. **Make sure to include this in each route group you'd like to track requests for, as attaching it to the global middleware will result in the session never being set**. You can disable this by setting the environment variable `APPINSIGHTS_TRACK_ANONYMOUS_USERS` to `false`.

Logging
-------

[](#logging)

Since 0.6.2 a custom monolog handler is provided for sending logs to application insights. This handler captures exceptions as well as other log levels. Exceptions are tracked as exceptions, and log messages are sent with their closes matching severity level.

To use this, update your `config/logging.php` configuration with the following:

```
'channels' => [
    // other channels...
    'app-insights' => [
        'driver' => 'custom',
        'via' => Yesdevs\ApplicationInsights\Logging\CreateApplicationInsightsLogger::class,
    ],
]
```

You might then choose to include this in your `stack` log handler:

```
'channels' => [
    // other channels...
    'stack' => [
        'driver' => 'stack',
        'channels' => ['stderr', 'daily', 'app-insights'],
    ],
]
```

Logging Migrations
------------------

[](#logging-migrations)

This package will automatically send migration events to application insights when enabled. Since 0.6.2 this includes when no migrations were ran. This is great for container images that run `php artisan migrate` on startup.

Support Matrix
--------------

[](#support-matrix)

Our VersionLaravel Version1.0.4^11, ^12, ^13^0.1.0^11.0

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance89

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~142 days

Total

5

Last Release

57d ago

PHP version history (2 changes)1.0.0PHP ^8.1.0

1.0.3PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/71517727?v=4)[aberbinYesdevs](/maintainers/aberbinYesdevs)[@aberbinYesdevs](https://github.com/aberbinYesdevs)

---

Top Contributors

[![ingalless](https://avatars.githubusercontent.com/u/22981941?v=4)](https://github.com/ingalless "ingalless (25 commits)")[![Yanisky](https://avatars.githubusercontent.com/u/10558597?v=4)](https://github.com/Yanisky "Yanisky (17 commits)")[![aberbinYesdevs](https://avatars.githubusercontent.com/u/71517727?v=4)](https://github.com/aberbinYesdevs "aberbinYesdevs (11 commits)")[![dnlyates](https://avatars.githubusercontent.com/u/80827431?v=4)](https://github.com/dnlyates "dnlyates (2 commits)")[![KobanDavis](https://avatars.githubusercontent.com/u/45386614?v=4)](https://github.com/KobanDavis "KobanDavis (1 commits)")

---

Tags

laravelmonitoringInsightsanalyticsYesdevs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yesdevs-laravel-application-insights/health.svg)

```
[![Health](https://phpackages.com/badges/yesdevs-laravel-application-insights/health.svg)](https://phpackages.com/packages/yesdevs-laravel-application-insights)
```

###  Alternatives

[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[lucianotonet/laravel-telescope-mcp

MCP Server extension for Laravel Telescope

2027.2k](/packages/lucianotonet-laravel-telescope-mcp)

PHPackages © 2026

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