faithgen /
events
| 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 EventDetails 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
Loading history...
|
|||
| 22 | 'name' => $this->name, |
||
|
0 ignored issues
–
show
The property
name does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 23 | 'location' => $this->location, |
||
|
0 ignored issues
–
show
The property
location does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 24 | 'published' => $this->published, |
||
|
0 ignored issues
–
show
The property
published does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 25 | 'description' => $this->description, |
||
|
0 ignored issues
–
show
The property
description does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 26 | 'url' => $this->url, |
||
|
0 ignored issues
–
show
The property
url does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 27 | 'video_url' => $this->video_url, |
||
|
0 ignored issues
–
show
The property
video_url does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 28 | 'start' => Helper::getDates($this->start), |
||
|
0 ignored issues
–
show
The property
start does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 29 | 'end' => Helper::getDates($this->end), |
||
|
0 ignored issues
–
show
The property
end does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 30 | 'is_past' => Carbon::parse($this->end)->isPast(), |
||
| 31 | 'date' => Carbon::parse($this->start)->format('Y/m/d'), |
||
| 32 | '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\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 33 | 'guests' => Guest::collection($this->guests), |
||
|
0 ignored issues
–
show
The property
guests does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 34 | ]; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |