Skip to content

Commit

Permalink
add MediaEntityResource
Browse files Browse the repository at this point in the history
  • Loading branch information
imahmood committed Nov 11, 2023
1 parent b83afc1 commit 6ede003
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Resources/MediaEntityResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Imahmood\FileStorage\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

/**
* @mixin \Imahmood\FileStorage\Models\Media
*/
class MediaEntityResource extends JsonResource
{
/**
* Transform the resource into an array.
*/
public function toArray($request): array
{
return [
'id' => $this->id,
'file_name' => $this->file_name,
'type' => $this->type,
'preview_url' => $this->preview_signed_url,
'original_url' => $this->original_signed_url,
];
}
}

0 comments on commit 6ede003

Please sign in to comment.