/** * @return \Illuminate\Routing\Route|null|string */ public function ingnoreId() { $id = $this->route('control'); $item_id = $this->input('item_id'); $test_category_id = $this->input('test_category_id'); $quantity_ordered = $this->input('quantity_ordered'); return Topup::where(compact('id', 'item_id', 'test_category_id', 'quantity_ordered'))->exists() ? $id : ''; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function delete($id) { //Soft delete the request $request = Topup::find($id); if (count($request->usage) > 0) { return redirect()->to('request.index')->with('message', trans('messages.failure-delete-record')); } else { $request->delete(); // redirect return redirect()->to('request.index')->with('message', trans('messages.record-successfully-deleted')); } }