Skip to content

Commit 6ede003

Browse files
committed
add MediaEntityResource
1 parent b83afc1 commit 6ede003

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Imahmood\FileStorage\Resources;
6+
7+
use Illuminate\Http\Resources\Json\JsonResource;
8+
9+
/**
10+
* @mixin \Imahmood\FileStorage\Models\Media
11+
*/
12+
class MediaEntityResource extends JsonResource
13+
{
14+
/**
15+
* Transform the resource into an array.
16+
*/
17+
public function toArray($request): array
18+
{
19+
return [
20+
'id' => $this->id,
21+
'file_name' => $this->file_name,
22+
'type' => $this->type,
23+
'preview_url' => $this->preview_signed_url,
24+
'original_url' => $this->original_signed_url,
25+
];
26+
}
27+
}

0 commit comments

Comments
 (0)