| @@ 176-184 (lines=9) @@ | ||
| 173 | * @return JsonResponse |
|
| 174 | * @internal param Club $club |
|
| 175 | */ |
|
| 176 | public function destroy($clubId) |
|
| 177 | { |
|
| 178 | $club = Club::find($clubId); |
|
| 179 | if ($club->delete()) { |
|
| 180 | return Response::json(['msg' => trans('msg.club_delete_successful', ['name' => $club->name]), 'status' => 'success']); |
|
| 181 | } else { |
|
| 182 | return Response::json(['msg' => trans('msg.club_delete_error', ['name' => $club->name]), 'status' => 'error']); |
|
| 183 | } |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * @param $id |
|
| @@ 190-199 (lines=10) @@ | ||
| 187 | * @param $id |
|
| 188 | * @return \Illuminate\Http\JsonResponse |
|
| 189 | */ |
|
| 190 | public function restore($id) |
|
| 191 | ||
| 192 | { |
|
| 193 | $club = Club::withTrashed()->find($id); |
|
| 194 | if ($club->restore()) { |
|
| 195 | return Response::json(['msg' => trans('msg.club_restored_successful', ['name' => $club->name]), 'status' => 'success']); |
|
| 196 | } else { |
|
| 197 | return Response::json(['msg' => trans('msg.club_restored_error', ['name' => $club->name]), 'status' => 'error']); |
|
| 198 | } |
|
| 199 | } |
|
| 200 | } |
|
| 201 | ||