create/get upload request backend

This commit is contained in:
Čarodej
2022-02-17 16:55:35 +01:00
parent 45a3b5415b
commit 6db8b0662a
15 changed files with 273 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace Domain\UploadRequest\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -12,16 +13,17 @@ class UploadRequestResource extends JsonResource
'id' => $this->id,
'type' => 'upload-request',
'attributes' => [
'folder_id' => $this->folder_id,
'status' => $this->status,
'email' => $this->email,
'notes' => $this->notes,
'folder_id' => $this->folder_id,
'status' => $this->status,
'email' => $this->email,
'notes' => $this->notes,
'url' => url("/request/$this->id/upload"),
],
'relationships' => [
'user' => [
'data' => [
'id' => $this->user->id,
'type' => 'user',
'id' => $this->user->id,
'type' => 'user',
'attributes' => [
'name' => $this->user->settings->name,
'avatar' => $this->user->settings->avatar,