app/Http/Controllers/TestProjectController.php
/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
Update the specified resource in storage.
@param  int  $id
@return Response
Update the specified resource in storage . @param int $id @return Response
public function update($id, Request $request)
	{
		$validator = \Validator::make($request->all(), array(
			'name' => 'required'         
			));
		if ($validator->fails())
		{
			foreach ($validator->errors()->toArray() as $key => $value) {
				$error[]=$value[0];
			} 
		}
		else{
			if( session()->has('email')){
				$content['tp_name']                 = $request->name;
				$content['release']                 = $request->release;
				$content['package_name']            = $request->package_name;
				$content['activity_name']           = $request->activity_name;
		        \App\TestProject::find($id)->update($content);
		        return redirect()->route('project.show', ['id' => $id]);
		 	}else
		 	{
		 		$error[] = "Session expired. Please login to continue";
		 	}
	 	}
	 	return redirect()->route('project.edit', ['id' => $id, 'message' => $error])->withInput();
	}
public function update ( $ id , Request $ request ) { $ validator = \ Validator :: make ( $ request -> all ( ) , array ( 'name' => 'required' ) ) ; if ( $ validator -> fails ( ) ) { foreach ( $ validator -> errors ( ) -> toArray ( ) as $ key => $ value ) { $ error [ ] = $ value [ 0 ] ; } } else { if ( session ( ) -> has ( 'email' ) ) { $ content [ 'tp_name' ] = $ request -> name ; $ content [ 'release' ] = $ request -> release ; $ content [ 'package_name' ] = $ request -> package_name ; $ content [ 'activity_name' ] = $ request -> activity_name ; \ App \ TestProject :: find ( $ id ) -> update ( $ content ) ; return redirect ( ) -> route ( 'project.show' , [ 'id' => $ id ] ) ; } else { $ error [ ] = " Session expired. Please login to continue " ; } } return redirect ( ) -> route ( 'project.edit' , [ 'id' => $ id , 'message' => $ error ] ) -> withInput ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//Validations //Process when validations pass //$content['app_wait_activity']       = $request->app_wait_activity;