APP als Hybrid Version - Anbindung an API
This commit is contained in:
parent
d054732bf5
commit
c1514999be
46 changed files with 3418 additions and 196 deletions
33
backend/app/Http/Resources/EventMediaResource.php
Normal file
33
backend/app/Http/Resources/EventMediaResource.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class EventMediaResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => (string) $this->id,
|
||||
'uuid' => $this->uuid,
|
||||
'type' => 'image',
|
||||
'collection' => $this->collection,
|
||||
'name' => $this->name,
|
||||
'mimeType' => $this->mime_type,
|
||||
'size' => $this->size,
|
||||
'width' => $this->width,
|
||||
'height' => $this->height,
|
||||
'thumbnailWidth' => $this->thumbnail_width,
|
||||
'thumbnailHeight' => $this->thumbnail_height,
|
||||
'previewWidth' => $this->preview_width,
|
||||
'previewHeight' => $this->preview_height,
|
||||
'src' => "/event-media/{$this->id}/thumb",
|
||||
'thumbnailUrl' => "/event-media/{$this->id}/thumb",
|
||||
'previewUrl' => "/event-media/{$this->id}/preview",
|
||||
'originalUrl' => "/event-media/{$this->id}/original",
|
||||
'createdAt' => $this->created_at->getTimestampMs(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue