1 | <?php |
||
2 | |||
3 | namespace Innoflash\Events\Http\Resources; |
||
4 | |||
5 | use Carbon\Carbon; |
||
6 | use FaithGen\SDK\Helpers\ImageHelper; |
||
7 | use Illuminate\Http\Resources\Json\JsonResource; |
||
8 | use InnoFlash\LaraStart\Helper; |
||
9 | |||
10 | class Event extends JsonResource |
||
11 | { |
||
12 | /** |
||
13 | * Transform the resource into an array. |
||
14 | * |
||
15 | * @param \Illuminate\Http\Request $request |
||
16 | * @return array |
||
17 | */ |
||
18 | public function toArray($request) |
||
19 | { |
||
20 | return [ |
||
21 | 'id' => $this->id, |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
22 | 'name' => $this->name, |
||
0 ignored issues
–
show
The property
name does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
23 | 'published' => $this->published, |
||
0 ignored issues
–
show
The property
published does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
24 | 'location' => $this->location, |
||
0 ignored issues
–
show
The property
location does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
25 | 'description' => $this->description, |
||
0 ignored issues
–
show
The property
description does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
26 | 'start' => Helper::getDates($this->start), |
||
0 ignored issues
–
show
The property
start does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
27 | 'end' => Helper::getDates($this->end), |
||
0 ignored issues
–
show
The property
end does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
28 | 'is_past' => Carbon::parse($this->end)->isPast(), |
||
29 | 'avatar' => ImageHelper::getImage('events', $this->image, config('faithgen-sdk.ministries-server')), |
||
0 ignored issues
–
show
The property
image does not exist on Innoflash\Events\Http\Resources\Event . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
30 | 'date' => Carbon::parse($this->start)->format('Y/m/d'), |
||
31 | ]; |
||
32 | } |
||
33 | } |
||
34 |