| @@ 120-128 (lines=9) @@ | ||
| 117 | * @param \Illuminate\Http\Request $request |
|
| 118 | * @return \Illuminate\Http\Response |
|
| 119 | */ |
|
| 120 | public function show($id) |
|
| 121 | { |
|
| 122 | $user = $this->user->findOrFail($id); |
|
| 123 | ||
| 124 | $response['user'] = $user; |
|
| 125 | $response['status'] = true; |
|
| 126 | ||
| 127 | return response()->json($response); |
|
| 128 | } |
|
| 129 | ||
| 130 | /** |
|
| 131 | * Show the form for editing the specified resource. |
|
| @@ 136-144 (lines=9) @@ | ||
| 133 | * @param \App\User $user |
|
| 134 | * @return \Illuminate\Http\Response |
|
| 135 | */ |
|
| 136 | public function edit($id) |
|
| 137 | { |
|
| 138 | $user = $this->user->findOrFail($id); |
|
| 139 | ||
| 140 | $response['user'] = $user; |
|
| 141 | $response['status'] = true; |
|
| 142 | ||
| 143 | return response()->json($response); |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * Update the specified resource in storage. |
|
| @@ 251-265 (lines=15) @@ | ||
| 248 | * @param \App\User $user |
|
| 249 | * @return \Illuminate\Http\Response |
|
| 250 | */ |
|
| 251 | public function destroy($id) |
|
| 252 | { |
|
| 253 | ||
| 254 | $user = $this->user->findOrFail($id); |
|
| 255 | ||
| 256 | $this->removeRole($id); |
|
| 257 | ||
| 258 | if ($user->delete()) { |
|
| 259 | $response['status'] = true; |
|
| 260 | } else { |
|
| 261 | $response['status'] = false; |
|
| 262 | } |
|
| 263 | ||
| 264 | return json_encode($response); |
|
| 265 | } |
|
| 266 | } |
|
| 267 | ||