app/Http/Controllers/TestStepController.php
/**
	 * commits reorder changes to db.
	 *
	 * @return Response
	 */
commits reorder changes to db.
@return Response
commits reorder changes to db . @return Response
public function reorder(Request $request)
	{
		$order_values = $request->all();
		if(count($order_values) === count(array_unique($order_values)))
		{
			foreach ($request->all() as $key => $value) {
				\App\TestStep::find($key)->update(['seq_no'=> $value]);
				\App\Execution::where('ts_id', $key)->update(['seq_no' => $value]);
			}
			$message = $this->getMessage('messages.reorder_success');
			Toast::message($message, 'success');
		}else{
			$message = $this->getMessage('messages.reorder_duplication');
			Toast::message($message, 'danger');
		}	
		return redirect()->back();
	}
public function reorder ( Request $ request ) { $ order_values = $ request -> all ( ) ; if ( count ( $ order_values ) === count ( array_unique ( $ order_values ) ) ) { foreach ( $ request -> all ( ) as $ key => $ value ) { \ App \ TestStep :: find ( $ key ) -> update ( [ 'seq_no' => $ value ] ) ; \ App \ Execution :: where ( 'ts_id' , $ key ) -> update ( [ 'seq_no' => $ value ] ) ; } $ message = $ this -> getMessage ( 'messages.reorder_success' ) ; Toast :: message ( $ message , 'success' ) ; } else { $ message = $ this -> getMessage ( 'messages.reorder_duplication' ) ; Toast :: message ( $ message , 'danger' ) ; } return redirect ( ) -> back ( ) ; }
commits reorder changes to db.
commits reorder changes to db .
//print_r($order_values); //echo " key = $key and value = $value";