public function validate()
    {
        foreach($this->rules() as $key => $value) {
            $this->rules[$key] =  [$this->input($key), $value];
        }

        $validate = $this->validator->validate($this->rules);

        if ($validate->fails()) {
            if($this->isAjax()) {
                return $this->response->json(['errors' => $validate->errors()->all()], 403);
            }

            return $this->redirect->backWith('errors', $validate->errors()->all());
        }
    }
public function validate()
    {
        foreach($this->rules() as $key => $value) {
            $this->rules[$key] =  [$this->input($key), $value];
        }

        $validate = $this->validator->validate($this->rules);

        if ($validate->fails()) {
            if($this->isAjax()) {
                return $this->response->json(['errors' => $validate->errors()->all()], 403);
            }

            return $this->redirect->backWith('errors', $validate->errors()->all());
        }
    }
public function validate ( ) { foreach ( $ this -> rules ( ) as $ key => $ value ) { $ this -> rules [ $ key ] = [ $ this -> input ( $ key ) , $ value ] ; } $ validate = $ this -> validator -> validate ( $ this -> rules ) ; if ( $ validate -> fails ( ) ) { if ( $ this -> isAjax ( ) ) { return $ this -> response -> json ( [ 'errors' => $ validate -> errors ( ) -> all ( ) ] , 403 ) ; } return $ this -> redirect -> backWith ( 'errors' , $ validate -> errors ( ) -> all ( ) ) ; } }
Validate requested form.

@return string
Validate requested form .