| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class UserTransformer extends Transformer |
||
| 17 | { |
||
| 18 | public $relations = [ |
||
| 19 | 'roles', |
||
| 20 | 'permissions' |
||
| 21 | ]; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Transform the resource into an array. |
||
| 25 | * |
||
| 26 | * @param \Illuminate\Http\Request $request |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | public function toArray($request) |
||
| 31 | { |
||
| 32 | return [ |
||
| 33 | 'id' => $this->id, |
||
|
|
|||
| 34 | 'name' => $this->name, |
||
| 35 | 'email' => $this->name, |
||
| 36 | 'email_verified' => $this->email_verified, |
||
| 37 | 'gender' => $this->gender, |
||
| 38 | 'provider' => $this->provider, |
||
| 39 | 'created_at' => $this->created_at, |
||
| 40 | 'updated_at' => $this->updated_at, |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function transformRoles(User $user) |
||
| 47 | } |
||
| 48 | |||
| 49 | public function transformPermissions(User $user) |
||
| 52 | } |
||
| 53 | } |
||
| 54 |