PHP code example of avalanche-development / crash-pad

1. Go to this page and download the library: Download avalanche-development/crash-pad 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/ */

    

avalanche-development / crash-pad example snippets


$talus = new Talus([...]);
$talus->setErrorHandler(new AvalancheDevelopment\CrashPad\ErrorHandler);

function someMiddleware($request, $response, $next) {
    $body = (string) $request->getBody();
    $body = json_decode($value);
    if (json_last_error() !== JSON_ERROR_NONE) {
        throw new AvalancheDevelopment\Peel\HttpError\BadRequest('Invalid JSON');
    }
    // etc
}