smuzi-ua /
dumka-backend
| 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 StudentResource extends JsonResource |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param Request $request |
||
| 12 | * @return array |
||
| 13 | */ |
||
| 14 | public function toArray($request) |
||
| 15 | { |
||
| 16 | return [ |
||
| 17 | 'id' => $this->id, |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 18 | 'name' => $this->name, |
||
|
0 ignored issues
–
show
The property
name does not exist on App\Http\Resources\StudentResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 19 | ]; |
||
| 20 | } |
||
| 21 | } |
||
| 22 |