Initial commit: Import existing Laravel project
This commit is contained in:
26
app/Http/Resources/AttachmentResource.php
Normal file
26
app/Http/Resources/AttachmentResource.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user