backend refactoring

This commit is contained in:
carodej
2020-04-27 08:34:09 +02:00
parent 586f0bba68
commit 65147870fd
22 changed files with 322 additions and 169 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ShareResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => [
'id' => (string)$this->id,
'type' => 'shares',
'attributes' => [
'permission' => $this->permission,
'protected' => $this->protected,
'item_id' => $this->item_id,
'token' => $this->token,
'link' => $this->link,
'type' => $this->type,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]
]
];
}
}