/** * Tests the update function in the ChargeController * @param void * @return void */ public function testDestroy() { $this->withoutMiddleware(); $this->call('POST', '/charge', $this->chargeData); $chargeStored = Charge::orderBy('id', 'desc')->first(); $chargeStored->delete($chargeStored->id); $this->assertEquals(Charge::all()->count(), 0); }
/** * Remove the specified charge from storage. * * @param int $id * @return Response */ public function destroy($id) { $charge = Charge::find($id); $url = session('SOURCE_URL'); return redirect()->to($url)->with('message', trans('terms.record-successfully-deleted')); }
/** * @return \Illuminate\Routing\Route|null|string */ public function ingnoreId() { $id = $this->route('charge'); $test_id = $this->input('test_id'); return Charge::where(compact('id', 'test_id'))->exists() ? $id : ''; }