1. Go to this page and download the library: Download jenky/hades 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/ */
jenky / hades example snippets
use Jenky\Hades\Hades;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Hades::errorFormat([
'message' => ':message',
'error_description' => ':error',
]);
}
use App\Exceptions\Transformers\MyCustomTransformer;
use Illuminate\Contracts\Debug\ExceptionHandler;
public function register(): void
{
$this->app->bind(MyCustomTransformer::class, static fn () => 'your binding logic');
$this->app->tag('api_error.exception_transformer', MyCustomTransformer::class);
}
use Jenky\Hades\Hades;
public function boot(): void
{
Hades::forceJsonOutput();
}