PHP code example of wachey / api

1. Go to this page and download the library: Download wachey/api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wachey / api example snippets


   'wachey' => [
       'key'      => env('WACHEY_API_KEY'),
       'password' => env('WACHEY_PASSWORD'),
   ],
   

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
        );
    });
}

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'
    );
}

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

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