ifx merge for update

This commit is contained in:
2020-08-01 17:34:10 +02:00
62 changed files with 3278 additions and 946 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class Event extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => [
'type' => 'events',
'event_id' => $this->id,
'attributes' => [
'data' => [
'name' => $this->name,
'description' => $this->description,
'start_date' => $this->start_date,
'end_date' => $this->end_date,
'location' => $this->location,
'category' => [
'data' => [
'category_id' => $this->category_id
],
],
]
],
],
'links' => [
'self' => url('/events/'.$this->id),
]
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class EventCategory extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'data' => [
'type' => 'event categories',
'event_category_id' => $this->id,
'attributes' => [
'data' => [
'name' => $this->name,
'description' => $this->description,
]
],
],
'links' => [
'self' => url('/events/categories/'.$this->id),
]
];
}
}

View File

@@ -27,6 +27,7 @@ class Memo extends JsonResource
'attributes' => [
'posted_by' => new UserResource($this->user),
'cover_image' => new ImageResource($this->coverImage),
'thumbnail_cover_image' => new ImageResource($this->thumbnailImage),
]
//'tags' => TagResource::collection($this->tags),
],

View File

@@ -24,6 +24,7 @@ class User extends JsonResource
'email' => $this->email,
'profile_image' => new ImageResource($this->profileImage),
'cover_image' => new ImageResource($this->coverImage),
'thumbnail_cover_image' => new ImageResource($this->thumbnailImage),
'last_login' => optional($this->login_at)->diffForHumans(),
'is_admin' => $this->isAdmin(),
],