You've already forked Php-Template
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 3m5s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Failing after 2m56s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 3m12s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 3m32s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 3m17s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m42s
39 lines
959 B
PHP
39 lines
959 B
PHP
<?php
|
|
|
|
namespace Siteworxpro\App\Http\Responses;
|
|
|
|
use Illuminate\Contracts\Support\Arrayable;
|
|
use Siteworxpro\HttpStatus\CodesEnum;
|
|
use OpenApi\Attributes as OA;
|
|
|
|
#[OA\Schema(
|
|
schema: 'NotFoundResponse',
|
|
properties: [
|
|
new OA\Property(
|
|
property: 'message',
|
|
type: 'string',
|
|
example: 'The requested resource /api/resource was not found.'
|
|
),
|
|
new OA\Property(
|
|
property: 'context',
|
|
description: 'Additional context about the not found error.',
|
|
type: 'object',
|
|
example: '{}'
|
|
),
|
|
]
|
|
)]
|
|
readonly class NotFoundResponse implements Arrayable
|
|
{
|
|
public function __construct(private string $uri, private array $context = [])
|
|
{
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'message' => 'The requested resource ' . $this->uri . ' was not found.',
|
|
'context' => $this->context,
|
|
];
|
|
}
|
|
}
|