add bookmark back

This commit is contained in:
2020-05-09 18:37:31 +02:00
parent 2f8e8ca378
commit a1b8962fe6
12 changed files with 520 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class Bookmark extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => [
'type' => 'bookmark',
'bookmark_id' => $this->id,
'attributes' => [
'data' => [
'name' => $this->name,
'url' => $this->url,
'favicon' => $this->favicon,
'created_at' => $this->created_at->diffForHumans(),
'last_updated' => $this->updated_at->diffForHumans(),
]
],
],
];
}
}