faithgen /
gallery
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace FaithGen\Gallery\Http\Resources; |
||||
| 4 | |||||
| 5 | use FaithGen\SDK\Helpers\ImageHelper; |
||||
| 6 | use Illuminate\Http\Resources\Json\JsonResource; |
||||
| 7 | use InnoFlash\LaraStart\Helper; |
||||
| 8 | |||||
| 9 | class Image 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
Loading history...
|
|||||
| 22 | 'caption' => $this->caption, |
||||
|
0 ignored issues
–
show
The property
caption does not exist on FaithGen\Gallery\Http\Resources\Image. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||||
| 23 | 'comments' => $this->comments()->count(), |
||||
|
0 ignored issues
–
show
The method
comments() does not exist on FaithGen\Gallery\Http\Resources\Image. 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
Loading history...
|
|||||
| 24 | 'avatar' => ImageHelper::getImage('gallery', $this->resource, config('faithgen-sdk.ministries-server')), |
||||
| 25 | 'date' => Helper::getDates($this->created_at), |
||||
|
0 ignored issues
–
show
The property
created_at does not exist on FaithGen\Gallery\Http\Resources\Image. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||||
| 26 | ]; |
||||
| 27 | } |
||||
| 28 | } |
||||
| 29 |