Download the PHP package wachey/api without Composer
On this page you can find all versions of the php package wachey/api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package api
Short Description Packet for a simple management of the API request for our monitoring platform
License
Informations about the package api
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: https://github.com/wachey-com/wachey-php
Features
- Laravel support via
config()
/env()
. - Non-Laravel support with automatic loading of a
.env
file inpublic_html
. - Zero external dependencies (uses native cURL).
- Simple integration with exception handlers.
Installation
Configuration
In Laravel
-
In your
config/services.php
, add: - Make sure your
.env
includes:
In Vanilla PHP
-
Place a
.env
file in yourpublic_html/
directory containing: - If your document root differs, define a constant before using the client:
define('PUBLIC_HTML_PATH', '/path/to/your/public_html'); ```
Usage
Automatic Exception Reporting in Laravel
In Laravel 9+ inside app/Exceptions/Handler.php
, register a reportable callback:
Manual Reporting
Wrap your code in a try-catch
and call Report::error()
:
API
- Returns:
\stdClass
on success, orfalse
if the JSON response is invalid. - Throws:
\RuntimeException
on cURL errors or missing.env
.
Env Loading Logic
- Laravel: Uses
config('services.wachey.key')
andconfig('services.wachey.password')
. - Non-Laravel: Parses
.env
underpublic_html
viaputenv()
and$_ENV
.
Adjust the path as needed via a PUBLIC_HTML_PATH
constant if you don’t use public_html
.
Project Structure
License
This project is released under the MIT License. See LICENSE for details.