add Event Catégory bien admin
This commit is contained in:
33
app/Http/Resources/EventCategory.php
Normal file
33
app/Http/Resources/EventCategory.php
Normal 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),
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user