This commit is contained in:
Čarodej
2021-11-03 17:34:46 +01:00
parent 98823504ba
commit cdaad931bb
40 changed files with 69 additions and 112 deletions
+3 -4
View File
@@ -1,5 +1,4 @@
<?php
namespace Domain\Files\Resources;
use Carbon\Carbon;
@@ -45,10 +44,10 @@ class FileResource extends JsonResource
),*/
],
'relationships' => [
$this->mergeWhen($this->shared, fn() => [
$this->mergeWhen($this->shared, fn () => [
'shared' => new ShareResource($this->shared),
]),
$this->mergeWhen($this->parent, fn() => [
$this->mergeWhen($this->parent, fn () => [
'parent' => [
'data' => [
'type' => 'folder',
@@ -59,7 +58,7 @@ class FileResource extends JsonResource
],
],
]),
$this->mergeWhen($this->owner, fn() => [
$this->mergeWhen($this->owner, fn () => [
'user' => [
'data' => [
'type' => 'user',