21 lines
552 B
PHP
21 lines
552 B
PHP
<?php
|
|
|
|
namespace App\Modules\Client\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ClientResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'client_number' => $this->client_number,
|
|
'name' => $this->name,
|
|
'notes' => $this->notes ?? [],
|
|
'created_at' => $this->created_at->toISOString(),
|
|
'updated_at' => $this->updated_at->toISOString(),
|
|
];
|
|
}
|
|
}
|