public function destroy(Request $request, $id) { $object = Option::find($id); if ($object) { $object->delete(); if ($request->ajax()) { return $this->responseAnswer(false, null, null, trans('trader.delTrader')); } else { return redirect()->back(); } } if ($request->ajax()) { return $this->responseAnswer(false, null, null, trans('trader.badTrader')); } else { return redirect()->back(); } }