Issues (13)

app/Http/Resources/StudentResource.php (2 issues)

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
The property id does not exist on App\Http\Resources\StudentResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
18
            'name' => $this->name,
0 ignored issues
show
Bug Best Practice introduced by
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