PHPackages                             wachey/api - 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. [API Development](/categories/api)
4. /
5. wachey/api

ActiveLibrary[API Development](/categories/api)

wachey/api
==========

Packet for a simple management of the API request for our monitoring platform

1.2.0(1y ago)01.3k↑16.7%PHP

Since May 18Pushed 1y agoCompare

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

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Wachey API PHP Client
=====================

[](#wachey-api-php-client)

A lightweight PHP client for sending error reports to the Wachey API, compatible with both **Laravel** and **vanilla PHP** projects.

> **Version:** 1.0.0 **License:** MIT **Repository:**

Features
--------

[](#features)

- **Laravel support** via `config()` / `env()`.
- **Non-Laravel support** with automatic loading of a `.env` file in `public_html`.
- Zero external dependencies (uses native cURL).
- Simple integration with exception handlers.

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

[](#installation)

```
composer require wachey/api
```

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

[](#configuration)

### In Laravel

[](#in-laravel)

1. In your `config/services.php`, add:

    ```
    'wachey' => [
        'key'      => env('WACHEY_API_KEY'),
        'password' => env('WACHEY_PASSWORD'),
    ],
    ```
2. Make sure your `.env` includes:

    ```
    WACHEY_API_KEY=your_api_key
    WACHEY_PASSWORD=your_password
    ```

### In Vanilla PHP

[](#in-vanilla-php)

- Place a `.env` file in your `public_html/` directory containing:

    ```
    WACHEY_API_KEY=your_api_key
    WACHEY_PASSWORD=your_password
    APP_ENV=production
    ```
- If your document root differs, define a constant **before** using the client:

    ```
    ```

define('PUBLIC\_HTML\_PATH', '/path/to/your/public\_html'); ```

Usage
-----

[](#usage)

### Automatic Exception Reporting in Laravel

[](#automatic-exception-reporting-in-laravel)

In Laravel 9+ inside **`app/Exceptions/Handler.php`**, register a reportable callback:

```
use Wachey\Api\Report;

public function register(): void
{
    $this->reportable(function (Throwable $e) {
        Report::error(
            $e->getMessage(),
            $e->getFile(),
            $e->getLine(),
            request()->ip(),
            optional(Auth::user())->email
        );
    });
}
```

### Manual Reporting

[](#manual-reporting)

Wrap your code in a `try-catch` and call `Report::error()`:

```
use Wachey\Api\Report;

try {
    // code that may throw
} catch (\Exception $e) {
    Report::error(
        $e->getMessage(),
        $e->getFile(),
        $e->getLine(),
        $_SERVER['REMOTE_ADDR'] ?? null,
        'optional_user_identifier'
    );
}
```

API
---

[](#api)

```
public static function error(
    ?string $error   = null,
    ?string $path    = null,
    ?int    $line    = null,
    ?string $ip      = null,
    ?string $user    = null
);
```

- **Returns**: `\stdClass` on success, or `false` if the JSON response is invalid.
- **Throws**: `\RuntimeException` on cURL errors or missing `.env`.

Env Loading Logic
-----------------

[](#env-loading-logic)

- **Laravel**: Uses `config('services.wachey.key')` and `config('services.wachey.password')`.
- **Non-Laravel**: Parses `.env` under `public_html` via `putenv()` and `$_ENV`.

Adjust the path as needed via a `PUBLIC_HTML_PATH` constant if you don’t use `public_html`.

Project Structure
-----------------

[](#project-structure)

```
src/
└── Report.php
composer.json
README.md
LICENSE

```

License
-------

[](#license)

This project is released under the **MIT License**. See [LICENSE](LICENSE) for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance49

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Every ~117 days

Total

4

Last Release

377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/550716a572380243417657131be8de2de3271e74a3f74d0e1ede0731cbdc72c5?d=identicon)[albertopisaroni](/maintainers/albertopisaroni)

---

Top Contributors

[![albertopisaroni](https://avatars.githubusercontent.com/u/45979126?v=4)](https://github.com/albertopisaroni "albertopisaroni (6 commits)")

### Embed Badge

![Health badge](/badges/wachey-api/health.svg)

```
[![Health](https://phpackages.com/badges/wachey-api/health.svg)](https://phpackages.com/packages/wachey-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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