protected function validateEnablingTwoFactorAuth(Request $request)
    {
        $input = $request->all();

        if (isset($input['phone_number'])) {
            $input['phone_number'] = str_replace(['-', '.'], '', $input['phone_number']);
        }

        $validator = Validator::make($input, [
            'country_code' => 'required|numeric|integer',
            'phone_number' => 'required|numeric',
        ]);

        if ($validator->fails()) {
            return response()->json($validator->errors()->all(), 422);
        }
    }
protected function validateEnablingTwoFactorAuth(Request $request)
    {
        $input = $request->all();

        if (isset($input['phone_number'])) {
            $input['phone_number'] = str_replace(['-', '.'], '', $input['phone_number']);
        }

        $validator = Validator::make($input, [
            'country_code' => 'required|numeric|integer',
            'phone_number' => 'required|numeric',
        ]);

        if ($validator->fails()) {
            return response()->json($validator->errors()->all(), 422);
        }
    }
protected function validateEnablingTwoFactorAuth ( Request $ request ) { $ input = $ request -> all ( ) ; if ( isset ( $ input [ 'phone_number' ] ) ) { $ input [ 'phone_number' ] = str_replace ( [ '-' , '.' ] , '' , $ input [ 'phone_number' ] ) ; } $ validator = Validator :: make ( $ input , [ 'country_code' => 'required|numeric|integer' , 'phone_number' => 'required|numeric' , ] ) ; if ( $ validator -> fails ( ) ) { return response ( ) -> json ( $ validator -> errors ( ) -> all ( ) , 422 ) ; } }
Validate an incoming request to enable two-factor authentication.

@param  \Illuminate\Http\Request  $request
@return \Illuminate\Http\Response|null
Validate an incoming request to enable two - factor authentication .