app/Http/Controllers/UserController.php
/**
	 * Verify email of the clicked link.
	 * 
	 */
Verify email of the clicked link.
Verify email of the clicked link .
public function verify_email()
		{
			$request                 = \Request::instance();
			$validator = \Validator::make($request->all(), array(
				'verification_code' => 'required',
				'email' => 'required|Email'           
				));
			if ($validator->fails())
			{
				foreach ($validator->errors()->toArray() as $key => $value) {
					$error[]=$value[0];
				} 
				return view('reset', ['info' => 'Verification failed. Please try again.', 'status' => 'failed']);
			}else{
				$email                   = $request->input('email');
				$email_verification_code = $request->input('verification_code');
				$update_cnt['verification'] = NULL;
				try
				{
					$update_user = \App\User::where('email', $email)->where('verification', $email_verification_code)->update($update_cnt);
					if ($update_user)
						return view('reset', ['info' => 'Email verified. Please set a new password.',  'status' => 'success', 'email' => $email]);
					else
						return view('reset', ['info' => 'Verification failed. Please try again.', 'status' => 'failed']);
				}
				catch (Exception $e)
				{
					return view('reset', ['info' => 'There was an error.Please try again.',  'status' => 'failed']);
				}
			}
		}
public function verify_email ( ) { $ request = \ Request :: instance ( ) ; $ validator = \ Validator :: make ( $ request -> all ( ) , array ( 'verification_code' => 'required' , 'email' => 'required|Email' ) ) ; if ( $ validator -> fails ( ) ) { foreach ( $ validator -> errors ( ) -> toArray ( ) as $ key => $ value ) { $ error [ ] = $ value [ 0 ] ; } return view ( 'reset' , [ 'info' => 'Verification failed. Please try again.' , 'status' => 'failed' ] ) ; } else { $ email = $ request -> input ( 'email' ) ; $ email_verification_code = $ request -> input ( 'verification_code' ) ; $ update_cnt [ 'verification' ] = NULL ; try { $ update_user = \ App \ User :: where ( 'email' , $ email ) -> where ( 'verification' , $ email_verification_code ) -> update ( $ update_cnt ) ; if ( $ update_user ) return view ( 'reset' , [ 'info' => 'Email verified. Please set a new password.' , 'status' => 'success' , 'email' => $ email ] ) ; else return view ( 'reset' , [ 'info' => 'Verification failed. Please try again.' , 'status' => 'failed' ] ) ; } catch ( Exception $ e ) { return view ( 'reset' , [ 'info' => 'There was an error.Please try again.' , 'status' => 'failed' ] ) ; } } }
Verify email of the clicked link.
Verify email of the clicked link .