PHPackages                             meemalabs/analytics-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. meemalabs/analytics-laravel

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

meemalabs/analytics-laravel
===========================

Laravel log driver for ts-analytics error collection

v0.1.0(2mo ago)11MITPHPPHP ^8.2

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/meemalabs/analytics-laravel)[ Packagist](https://packagist.org/packages/meemalabs/analytics-laravel)[ RSS](/packages/meemalabs-analytics-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Analytics Laravel
=================

[](#analytics-laravel)

A Laravel log driver that sends errors and log entries to your [ts-analytics](https://github.com/stacksjs/analytics) server. Works like Flare or Bugsnag — configure it once and Laravel's exception handler automatically reports errors through the logging pipeline.

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

[](#installation)

```
composer require meemalabs/analytics-laravel
```

The service provider is auto-discovered by Laravel.

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=analytics-config
```

Add these to your `.env`:

```
ANALYTICS_TOKEN=ak_your_api_key
ANALYTICS_SITE_ID=my-site
```

Add the `analytics` channel to your `config/logging.php`:

```
'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['daily', 'analytics'],
    ],

    'analytics' => [
        'driver' => 'analytics',
        'level' => 'error',
    ],
],
```

That's it. Exceptions and error-level log entries are now sent to your analytics server automatically.

Config Reference
----------------

[](#config-reference)

All options in `config/analytics.php`:

KeyEnv VarDefaultDescription`token``ANALYTICS_TOKEN``''`API key (must start with `ak_`)`site_id``ANALYTICS_SITE_ID``''`Site identifier`environment``ANALYTICS_ENVIRONMENT``APP_ENV`Environment name in reports`enabled``ANALYTICS_ENABLED``true`Kill switch to disable reporting`level``ANALYTICS_LOG_LEVEL``error`Minimum log level to reportHow It Works
------------

[](#how-it-works)

1. The package registers an `analytics` Monolog log driver via `Log::extend()`
2. When Laravel logs an error (or an exception is thrown), the log record reaches the `AnalyticsLogHandler`
3. If the log context contains a `Throwable`, a full error report is built with class name, message, stack trace, file, and line
4. Otherwise, a message-level report is built from the log message
5. The report is sent via HTTP POST to the analytics endpoint (`/errors/collect`) with the `X-Analytics-Token` header
6. The HTTP call uses a 5-second timeout and silently catches failures — logging never crashes the app

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

[](#requirements)

- PHP 8.2+
- Laravel 11+

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance87

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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

Unknown

Total

1

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86ae8df6a3e7b071e4831eed7228eaa9690c44f19a69751bbb075aad609bbca0?d=identicon)[knightsky123](/maintainers/knightsky123)

---

Top Contributors

[![glennmichael123](https://avatars.githubusercontent.com/u/29087513?v=4)](https://github.com/glennmichael123 "glennmichael123 (7 commits)")[![chrisbbreuer](https://avatars.githubusercontent.com/u/6228425?v=4)](https://github.com/chrisbbreuer "chrisbbreuer (1 commits)")

---

Tags

laravellogginganalyticsmonologerror-tracking

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/meemalabs-analytics-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/meemalabs-analytics-laravel/health.svg)](https://phpackages.com/packages/meemalabs-analytics-laravel)
```

###  Alternatives

[naoray/laravel-github-monolog

Log driver to store logs as github issues

10619.4k](/packages/naoray-laravel-github-monolog)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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