app/Http/Controllers/TestcaseController.php
/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
Remove the specified resource from storage.
@param  int  $id
@return Response
Remove the specified resource from storage . @param int $id @return Response
public function destroy($id)
	{
		$tp_id = session()->get('open_project');
		$item = \App\TestCase::find($id);
		$sc_id = $item->tsc_id;
        if($item){
        	$del_obj = new DeleteQueryHandler();
        	$del_res = $del_obj->deleteStepsByCaseId($id);
			if($del_res == 0)
			{
				$message = $this->getMessage('messages.delete_failed');
				Toast::message($message, 'danger');
			}  else{      	
        		$del_res = $del_obj->deleteLabByCaseId($id);
				if($del_res == 0)
				{
					$message = $this->getMessage('messages.delete_failed');
					Toast::message($message, 'danger');
				}  else{
		        	$item->delete();
					$message = $this->getMessage('messages.delete_success');
					Toast::success($message);
				}
			}
        }
		else{
			$message = $this->getMessage('messages.delete_failed');
			Toast::message($message, 'danger');
		}
		return redirect()->route('scenario.show', $sc_id);
	}
public function destroy ( $ id ) { $ tp_id = session ( ) -> get ( 'open_project' ) ; $ item = \ App \ TestCase :: find ( $ id ) ; $ sc_id = $ item -> tsc_id ; if ( $ item ) { $ del_obj = new DeleteQueryHandler ( ) ; $ del_res = $ del_obj -> deleteStepsByCaseId ( $ id ) ; if ( $ del_res == 0 ) { $ message = $ this -> getMessage ( 'messages.delete_failed' ) ; Toast :: message ( $ message , 'danger' ) ; } else { $ del_res = $ del_obj -> deleteLabByCaseId ( $ id ) ; if ( $ del_res == 0 ) { $ message = $ this -> getMessage ( 'messages.delete_failed' ) ; Toast :: message ( $ message , 'danger' ) ; } else { $ item -> delete ( ) ; $ message = $ this -> getMessage ( 'messages.delete_success' ) ; Toast :: success ( $ message ) ; } } } else { $ message = $ this -> getMessage ( 'messages.delete_failed' ) ; Toast :: message ( $ message , 'danger' ) ; } return redirect ( ) -> route ( 'scenario.show' , $ sc_id ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .
//Delete testcase