PHPackages                             aihealth/laravel-monitor - 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. aihealth/laravel-monitor

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

aihealth/laravel-monitor
========================

AI Store Health Monitor SDK for Laravel

v1.0.0(4mo ago)012↓91.7%MITPHPPHP ^8.0

Since Feb 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vyasvatsal/aihealth-laravel-sdk)[ Packagist](https://packagist.org/packages/aihealth/laravel-monitor)[ RSS](/packages/aihealth-laravel-monitor/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

AI Health Laravel SDK Setup Guide
=================================

[](#ai-health-laravel-sdk-setup-guide)

Welcome to the **AI Health Laravel SDK**. This SDK integrates seamlessly into your Laravel application to provide powerful error detection, background health analysis, Web/Real User Monitoring (RUM), and Conversion/CTA tracking.

This guide covers the all-in-one setup.

---

1. Installation
---------------

[](#1-installation)

Because the SDK is currently in private development, you need to add our repository to your `composer.json` before installing:

```
composer config repositories.aihealth vcs https://github.com/vyasvatsal/aihealth-laravel-sdk.git
composer require aihealth/laravel-monitor
```

---

2. Configuration &amp; Initialization
-------------------------------------

[](#2-configuration--initialization)

Publish the configuration file:

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

In your project's `.env` file, add your DSN (Data Source Name) provided by the Health Monitor dashboard.

```
# Backend API Key (DSN) - Contains your Public Key, Host URL, and Project ID
# Format: http://{public_key}@{host}/{project_id}
AIHEALTH_DSN="http://your_public_key@127.0.0.1:8000/1"

# Frontend Private Tracking Key (Required for RUM & CTA Analytics)
AIHEALTH_PRIVATE_TRACKING_KEY="rum_your_private_key_here"

# Enable/Disable modules
AIHEALTH_SEND_EXCEPTIONS=true
AIHEALTH_SEND_LOGS=true
AIHEALTH_SEND_TRANSACTIONS=true
```

---

3. Module 1: Error &amp; Log Detection
--------------------------------------

[](#3-module-1-error--log-detection)

By simply setting the `AIHEALTH_DSN`, the SDK auto-discovers and intercepts exceptions and log messages (using Laravel's built-in handlers). You don't need to change your `bootstrap/app.php` or `Handler.php`!

The `AIHealthServiceProvider` automatically binds the `ErrorHandler` and `LogHandler` to Laravel's logging channels.

*Tip: To test if errors are being sent, you can trigger a manual exception in a route:*

```
Route::get('/debug-sentry', function () {
    throw new Exception('My first SDK error!');
});
```

---

4. Module 2: Background Health Analysis
---------------------------------------

[](#4-module-2-background-health-analysis)

The Health Analysis module monitors CPU load, Memory limits, and Database connectivity.

The SDK automatically registers a background heartbeat that runs every five minutes. The only requirement is that your server must have Laravel's base CRON scheduler running.

Make sure your server is running the standard Laravel cron job (normally set up once per server): `* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1`

---

5. Module 3: Web Analysis (RUM) &amp; CTA Tracking
--------------------------------------------------

[](#5-module-3-web-analysis-rum--cta-tracking)

Real User Monitoring tracks page load speeds, core web vitals, user sessions, and interactions (such as Call-To-Action clicks).

To enable this, add the following Blade directive to your main layout file (`resources/views/layouts/app.blade.php`), right before the closing `` tag:

```

    @aihealth

```

*(Note: Ensure `AIHEALTH_PRIVATE_TRACKING_KEY` and `AIHEALTH_RUM_ENDPOINT` are correctly filled in your `config/aihealth.php` or `.env` file, though the SDK auto-fetches them from the monitor if configured correctly via DSN).*

### Automatic CTA Tracking

[](#automatic-cta-tracking)

The RUM script automatically finds clickable elements and tracks user flows. To explicitly tag critical buttons (like "Checkout" or "Sign Up") for enhanced conversion tracking, add the `data-aihealth-cta` attribute to your HTML elements:

```

    Complete Purchase

    View Pricing

```

6. Module 4: Route Synchronization (Web Crawler)
------------------------------------------------

[](#6-module-4-route-synchronization-web-crawler)

To enable the Health Monitor to automatically crawl your pages and discover conversion/CTA flows, you need to synchronize your application's routes to the dashboard.

Run the following command once, or whenever you add new frontend-facing routes:

```
php artisan aihealth:sync-routes
```

Troubleshooting
---------------

[](#troubleshooting)

### SSL Certificate Error (cURL error 60)

[](#ssl-certificate-error-curl-error-60)

If you see an error like `SSL certificate problem: unable to get local issuer certificate`, it means your local environment (like XAMPP or Laragon) isn't configured with a trusted root CA.

To bypass this for **local development ONLY**, add this to your `.env`:

```
AIHEALTH_VERIFY_SSL=false
```

### "There are no commands defined in the aihealth namespace"

[](#there-are-no-commands-defined-in-the-aihealth-namespace)

If you've installed the SDK but cannot run the `php artisan aihealth:*` commands, try clearing your artisan cache:

```
php artisan config:clear
php artisan cache:clear
php artisan package:discover
```

---

Summary
-------

[](#summary)

With these simple steps, your Laravel application is fully instrumented:

1. **Composer Require &amp; .env API Keys** (Activates the SDK, Error Tracking, Logs, Transactions, and Background Health Monitor)
2. **`@aihealth` Blade Directive** (Activates Web/RUM analysis and Frontend CTA interactions)
3. **Command Execution** (`aihealth:sync-routes` to initialize Web Analysis crawling)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance77

Regular maintenance activity

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

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

129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee57234ae75cc0edac8a829510c1ada41d6c0f9a7bf6152aeaab1b3764b64c7a?d=identicon)[vyasvatsal](/maintainers/vyasvatsal)

---

Top Contributors

[![vyasvatsal](https://avatars.githubusercontent.com/u/111115251?v=4)](https://github.com/vyasvatsal "vyasvatsal (16 commits)")

### Embed Badge

![Health badge](/badges/aihealth-laravel-monitor/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k90.5k1](/packages/mike-bronner-laravel-model-caching)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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