public function withValidator( $validator ) { if ( $validator->fails() ) { // Handle errors } ... }