1 | <?php |
||
2 | |||
3 | namespace App\Http\Resources; |
||
4 | |||
5 | use Illuminate\Http\Request; |
||
6 | use Illuminate\Http\Resources\Json\JsonResource; |
||
7 | |||
8 | final class SchoolResource extends JsonResource |
||
9 | { |
||
10 | /** |
||
11 | * @param Request $request |
||
12 | * @return array |
||
13 | */ |
||
14 | public function toArray($request): array |
||
15 | { |
||
16 | return [ |
||
17 | 'id' => $this->id, |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
18 | 'name' => $this->name, |
||
0 ignored issues
–
show
The property
name does not exist on App\Http\Resources\SchoolResource . Since you implemented __get , consider adding a @property annotation.
![]() |
|||
19 | ]; |
||
20 | } |
||
21 | } |
||
22 |