/**
  * @test delete
  */
 public function testDeleteAjuda()
 {
     $ajuda = $this->makeAjuda();
     $resp = $this->ajudaRepo->delete($ajuda->id);
     $this->assertTrue($resp);
     $this->assertNull(Ajuda::find($ajuda->id), 'Ajuda should not exist in DB');
 }
Пример #2
0
 /**
  * Remove the specified Ajuda from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $ajuda = $this->ajudaRepository->findWithoutFail($id);
     if (empty($ajuda)) {
         Flash::error('Ajuda not found');
         return redirect(route('ajudas.index'));
     }
     $this->ajudaRepository->delete($id);
     Flash::success('Ajuda deleted successfully.');
     return redirect(route('ajudas.index'));
 }