1 | <?php |
||
2 | |||
3 | namespace FaithGen\SDK\Http\Resources; |
||
4 | |||
5 | use FaithGen\SDK\Helpers\ImageHelper; |
||
6 | use Illuminate\Http\Resources\Json\JsonResource; |
||
7 | |||
8 | class Ministry extends JsonResource |
||
9 | { |
||
10 | /** |
||
11 | * Transform the resource into an array. |
||
12 | * |
||
13 | * @param \Illuminate\Http\Request $request |
||
14 | * |
||
15 | * @return array |
||
16 | */ |
||
17 | public function toArray($request) |
||
18 | { |
||
19 | $results = parent::toArray($request); |
||
20 | $results = array_merge($results, [ |
||
21 | 'active' => (bool) optional($this->activation)->active, |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
22 | 'avatar' => ImageHelper::getImage('profile', $this->image), |
||
0 ignored issues
–
show
The property
image does not exist on FaithGen\SDK\Http\Resources\Ministry . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
23 | 'level' => optional($this->account)->level, |
||
0 ignored issues
–
show
The property
account does not exist on FaithGen\SDK\Http\Resources\Ministry . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
24 | ]); |
||
25 | |||
26 | return $results; |
||
27 | } |
||
28 | } |
||
29 |