27 lines
630 B
PHP
27 lines
630 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AttachmentResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'order_id' => $this->order_id,
|
|
'file_name' => $this->file_name,
|
|
'file_type' => $this->file_type,
|
|
'url' => $this->url,
|
|
'created_at' => $this->created_at?->format('d/m/Y H:i'),
|
|
];
|
|
}
|
|
}
|