| @@ 79-93 (lines=15) @@ | ||
| 76 | * |
|
| 77 | * @return \Illuminate\Http\Response |
|
| 78 | */ |
|
| 79 | public function get() |
|
| 80 | { |
|
| 81 | $master_zonas = $this->master_zona->with(['user'])->get(); |
|
| 82 | ||
| 83 | // foreach($master_zonas as $master_zona){ |
|
| 84 | // array_set($master_zona, 'label', $master_zona->label); |
|
| 85 | // } |
|
| 86 | ||
| 87 | $response['master_zonas'] = $master_zonas; |
|
| 88 | $response['error'] = false; |
|
| 89 | $response['message'] = 'Success'; |
|
| 90 | $response['status'] = true; |
|
| 91 | ||
| 92 | return response()->json($response); |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * Show the form for creating a new resource. |
|
| @@ 185-195 (lines=11) @@ | ||
| 182 | * @param \App\MasterZona $master_zona |
|
| 183 | * @return \Illuminate\Http\Response |
|
| 184 | */ |
|
| 185 | public function show($id) |
|
| 186 | { |
|
| 187 | $master_zona = $this->master_zona->with(['user'])->findOrFail($id); |
|
| 188 | ||
| 189 | $response['master_zona'] = $master_zona; |
|
| 190 | $response['error'] = false; |
|
| 191 | $response['message'] = 'Success'; |
|
| 192 | $response['status'] = true; |
|
| 193 | ||
| 194 | return response()->json($response); |
|
| 195 | } |
|
| 196 | ||
| 197 | /** |
|
| 198 | * Show the form for editing the specified resource. |
|
| @@ 198-208 (lines=11) @@ | ||
| 195 | * @param \App\Zona $zona |
|
| 196 | * @return \Illuminate\Http\Response |
|
| 197 | */ |
|
| 198 | public function show($id) |
|
| 199 | { |
|
| 200 | $zona = $this->zona->with(['siswa', 'sekolah', 'user'])->findOrFail($id); |
|
| 201 | ||
| 202 | $response['zona'] = $zona; |
|
| 203 | $response['error'] = false; |
|
| 204 | $response['message'] = 'Success'; |
|
| 205 | $response['status'] = true; |
|
| 206 | ||
| 207 | return response()->json($response); |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Show the form for editing the specified resource. |
|