예제 #1
0
 /**
  * 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);
 }
예제 #2
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'));
 }
예제 #3
0
 /**
  * @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 : '';
 }