topUpSettingService = $topUpSettingService; } public function index() { $response = $this->topUpSettingService->getAllSettings(); if (!$response['success']) { return back()->with('error', $response['message']); } return view('pages.top-up-settings', [ 'settings' => $response['data'] ]); } public function store(Request $request) { $response = $this->topUpSettingService->createSetting($request->all()); if (!$response['success']) { return back()->withInput()->with('error', $response['message']); } return redirect()->route('top-up-settings.index') ->with('success', 'Setting created successfully'); } public function update(Request $request, $id) { $response = $this->topUpSettingService->updateSetting($id, $request->all()); if (!$response['success']) { return back()->withInput()->with('error', $response['message']); } return redirect()->route('top-up-settings.index') ->with('success', 'Setting updated successfully'); } public function destroy($id) { $response = $this->topUpSettingService->deleteSetting($id); if (!$response['success']) { return back()->with('error', $response['message']); } return redirect()->route('top-up-settings.index') ->with('success', 'Setting deleted successfully'); } }