add Event Catégory bien admin

This commit is contained in:
2020-07-19 13:03:32 +02:00
parent 1e7e1fc09e
commit 6a1c83dc59
6 changed files with 109 additions and 3 deletions

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),
]
];
}
}