Issues (94)

src/Http/Resources/Ministry.php (3 issues)

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
The property activation does not exist on FaithGen\SDK\Http\Resources\Ministry. Since you implemented __get, consider adding a @property annotation.
Loading history...
22
            'avatar' => ImageHelper::getImage('profile', $this->image),
0 ignored issues
show
Bug Best Practice introduced by
The property image does not exist on FaithGen\SDK\Http\Resources\Ministry. Since you implemented __get, consider adding a @property annotation.
Loading history...
23
            'level'  => optional($this->account)->level,
0 ignored issues
show
Bug Best Practice introduced by
The property account does not exist on FaithGen\SDK\Http\Resources\Ministry. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
        ]);
25
26
        return $results;
27
    }
28
}
29