1 | <?php |
||||
2 | |||||
3 | namespace FaithGen\SDK\Http\Resources; |
||||
4 | |||||
5 | use FaithGen\SDK\Helpers\ImageHelper; |
||||
6 | use Illuminate\Http\Resources\Json\JsonResource; |
||||
7 | use InnoFlash\LaraStart\Helper; |
||||
8 | |||||
9 | class Profile extends JsonResource |
||||
10 | { |
||||
11 | /** |
||||
12 | * Transform the resource into an array. |
||||
13 | * |
||||
14 | * @param \Illuminate\Http\Request $request |
||||
15 | * |
||||
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 FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
23 | 'email' => $this->email, |
||||
0 ignored issues
–
show
The property
email does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
24 | 'phone' => $this->phone, |
||||
0 ignored issues
–
show
The property
phone does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
25 | 'color' => $this->profile->color, |
||||
0 ignored issues
–
show
The property
profile does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
26 | 'active' => (bool) $this->activation->active, |
||||
0 ignored issues
–
show
The property
activation does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
27 | 'api_key' => $this->apiKey->api_key, |
||||
0 ignored issues
–
show
The property
apiKey does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
28 | 'avatar' => ImageHelper::getImage('profile', $this->image, config('faithgen-sdk.ministries-server')), |
||||
0 ignored issues
–
show
The property
image does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
29 | 'date' => Helper::getDates($this->created_at), |
||||
0 ignored issues
–
show
The property
created_at does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
30 | 'users' => [ |
||||
31 | 'count' => $this->ministryUsers()->count(), |
||||
0 ignored issues
–
show
The method
ministryUsers() does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __call , consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
32 | ], |
||||
33 | 'location' => is_array($this->profile->location) |
||||
34 | ? $this->profile->location |
||||
35 | : json_decode($this->profile->location), |
||||
36 | 'links' => [ |
||||
37 | 'website' => $this->profile->website, |
||||
38 | 'facebook' => $this->profile->facebook, |
||||
39 | 'youtube' => $this->profile->youtube, |
||||
40 | 'twitter' => $this->profile->twitter, |
||||
41 | 'instagram' => $this->profile->instagram, |
||||
42 | ], |
||||
43 | 'contact' => [ |
||||
44 | 'phones' => $this->phones, |
||||
0 ignored issues
–
show
The property
phones does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
45 | 'emails' => $this->emails, |
||||
0 ignored issues
–
show
The property
emails does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
46 | ], |
||||
47 | 'services' => DailyService::collection($this->services), |
||||
0 ignored issues
–
show
The property
services does not exist on FaithGen\SDK\Http\Resources\Profile . Since you implemented __get , consider adding a @property annotation.
![]() |
|||||
48 | 'statement' => [ |
||||
49 | 'vision' => $this->profile->vision, |
||||
50 | 'mission' => $this->profile->mission, |
||||
51 | 'about_us' => $this->profile->about_us, |
||||
52 | ], |
||||
53 | ]; |
||||
54 | } |
||||
55 | } |
||||
56 |