| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class EventResource extends JsonResource |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Transform the resource into an array. |
||
| 12 | * |
||
| 13 | * @param \Illuminate\Http\Request $request |
||
| 14 | * @return array |
||
| 15 | */ |
||
| 16 | public function toArray($request) |
||
| 17 | { |
||
| 18 | return [ |
||
| 19 | 'type' => 'events', |
||
| 20 | 'id' => (string) $this->id, |
||
|
|
|||
| 21 | 'attributes' => parent::toArray($request), |
||
| 22 | 'links' => [ |
||
| 23 | 'self' => adminShowRoute('event', $this->id) |
||
| 24 | ] |
||
| 25 | ]; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get additional data that should be returned with the resource array. |
||
| 30 | * |
||
| 31 | * @param \Illuminate\Http\Request $request |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function with($request) |
||
| 39 | ], |
||
| 40 | ]; |
||
| 43 |