PHP code example of bayfrontmedia / array-schema
1. Go to this page and download the library: Download bayfrontmedia/array-schema 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/ */
bayfrontmedia / array-schema example snippets
use Bayfront\ArraySchema\Schemas\ErrorDocument;
$errors = [
[
'status' => '401',
'title' => 'Unauthorized',
'detail' => 'Invalid or missing credentials',
'code' => '0',
'links' => [
'about' => 'link to documentation'
]
]
];
echo json_encode(ErrorDocument::create($errors));