Files
solidtime/app/Http/Resources/V1/Client/ClientResource.php
Constantin Graf 7a3a9d7089 Fix Scramble API docs warnings
Remove redundant @var annotations from API resources and defer the user
access in the email unique rule of UserUpdateRequest, so rules() can be
evaluated by Scramble without route model binding. Add a test that fails
on any Scramble diagnostic and tests for the email unique rule.
2026-10-08 12:57:56 +02:00

37 lines
957 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Resources\V1\Client;
use App\Http\Resources\V1\BaseResource;
use App\Models\Client;
use Illuminate\Http\Request;
/**
* @property Client $resource
*/
class ClientResource extends BaseResource
{
/**
* Transform the resource into an array.
*
* @return array<string, string|bool|int|null>
*/
public function toArray(Request $request): array
{
return [
/** ID */
'id' => $this->resource->id,
/** Name */
'name' => $this->resource->name,
/** Whether the client is archived */
'is_archived' => $this->resource->is_archived,
/** When the tag was created */
'created_at' => $this->formatDateTime($this->resource->created_at),
/** When the tag was last updated */
'updated_at' => $this->formatDateTime($this->resource->updated_at),
];
}
}