@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | protected function ValidateIdentity($attribute, $value, $perameters, $validator) |
| 255 | 255 | |
| 256 | 256 | { |
| 257 | - // dd($value); |
|
| 257 | + // dd($value); |
|
| 258 | 258 | |
| 259 | 259 | foreach ($validator->getData() as $data) { |
| 260 | 260 | |
@@ -263,16 +263,16 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | //dd(true); |
| 265 | 265 | |
| 266 | - if(!strcmp($data['identity_type'],"BC")) |
|
| 267 | - { |
|
| 266 | + if(!strcmp($data['identity_type'],"BC")) |
|
| 267 | + { |
|
| 268 | 268 | $out = 1; |
| 269 | - } |
|
| 270 | - else |
|
| 271 | - { |
|
| 272 | - $out = 2; |
|
| 273 | - } |
|
| 269 | + } |
|
| 270 | + else |
|
| 271 | + { |
|
| 272 | + $out = 2; |
|
| 273 | + } |
|
| 274 | 274 | |
| 275 | - if(($out == 1)&&(preg_match('/^[0-9]{4}+$/',$value))) |
|
| 275 | + if(($out == 1)&&(preg_match('/^[0-9]{4}+$/',$value))) |
|
| 276 | 276 | { |
| 277 | 277 | //dd(true); |
| 278 | 278 | return true; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | elseif (($out == 2) &&(preg_match('/^[0-9]{9}[VX]{1}+$/',$value))) |
| 283 | - { |
|
| 283 | + { |
|
| 284 | 284 | return true; |
| 285 | 285 | } |
| 286 | 286 | elseif (($out == 2) && (preg_match('/^[0-9]{12}+$/',$value))) |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | return true; |
| 289 | 289 | } |
| 290 | 290 | else { |
| 291 | - //dd(false); |
|
| 291 | + //dd(false); |
|
| 292 | 292 | $this ->_custom_messages['unmatch'] = $attribute." format does not match with Identity type"; |
| 293 | 293 | $this->_set_custom_stuff(); |
| 294 | 294 | return false; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | elseif (preg_match('/^[0-9]{9}[VX]{1}+$/',$value)) |
| 310 | - { |
|
| 310 | + { |
|
| 311 | 311 | return true; |
| 312 | 312 | } |
| 313 | 313 | elseif (preg_match('/^[0-9]{12}+$/',$value)) |
@@ -266,8 +266,7 @@ discard block |
||
| 266 | 266 | if(!strcmp($data['identity_type'],"BC")) |
| 267 | 267 | { |
| 268 | 268 | $out = 1; |
| 269 | - } |
|
| 270 | - else |
|
| 269 | + } else |
|
| 271 | 270 | { |
| 272 | 271 | $out = 2; |
| 273 | 272 | } |
@@ -277,44 +276,34 @@ discard block |
||
| 277 | 276 | //dd(true); |
| 278 | 277 | return true; |
| 279 | 278 | |
| 280 | - } |
|
| 281 | - |
|
| 282 | - elseif (($out == 2) &&(preg_match('/^[0-9]{9}[VX]{1}+$/',$value))) |
|
| 279 | + } elseif (($out == 2) &&(preg_match('/^[0-9]{9}[VX]{1}+$/',$value))) |
|
| 283 | 280 | { |
| 284 | 281 | return true; |
| 285 | - } |
|
| 286 | - elseif (($out == 2) && (preg_match('/^[0-9]{12}+$/',$value))) |
|
| 282 | + } elseif (($out == 2) && (preg_match('/^[0-9]{12}+$/',$value))) |
|
| 287 | 283 | { |
| 288 | 284 | return true; |
| 289 | - } |
|
| 290 | - else { |
|
| 285 | + } else { |
|
| 291 | 286 | //dd(false); |
| 292 | 287 | $this ->_custom_messages['unmatch'] = $attribute." format does not match with Identity type"; |
| 293 | 288 | $this->_set_custom_stuff(); |
| 294 | 289 | return false; |
| 295 | 290 | |
| 296 | 291 | } |
| 297 | - } |
|
| 298 | - else if(($data['identity_type'] != null)&&($value == null)){ |
|
| 292 | + } else if(($data['identity_type'] != null)&&($value == null)){ |
|
| 299 | 293 | return true; |
| 300 | - } |
|
| 301 | - else { |
|
| 294 | + } else { |
|
| 302 | 295 | if(preg_match('/^[0-9]{4}+$/',$value)) |
| 303 | 296 | { |
| 304 | 297 | //dd(true); |
| 305 | 298 | return true; |
| 306 | 299 | |
| 307 | - } |
|
| 308 | - |
|
| 309 | - elseif (preg_match('/^[0-9]{9}[VX]{1}+$/',$value)) |
|
| 300 | + } elseif (preg_match('/^[0-9]{9}[VX]{1}+$/',$value)) |
|
| 310 | 301 | { |
| 311 | 302 | return true; |
| 312 | - } |
|
| 313 | - elseif (preg_match('/^[0-9]{12}+$/',$value)) |
|
| 303 | + } elseif (preg_match('/^[0-9]{12}+$/',$value)) |
|
| 314 | 304 | { |
| 315 | 305 | return true; |
| 316 | - } |
|
| 317 | - else { |
|
| 306 | + } else { |
|
| 318 | 307 | $this ->_custom_messages['idnum'] = $attribute." format is invalild"; |
| 319 | 308 | $this->_set_custom_stuff(); |
| 320 | 309 | return false; |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function boot() |
|
| 29 | - { |
|
| 30 | - // |
|
| 31 | - if(!(\App::environment('local'))) { |
|
| 32 | - URL::forceScheme('https'); |
|
| 33 | - } |
|
| 34 | - } |
|
| 28 | + public function boot() |
|
| 29 | + { |
|
| 30 | + // |
|
| 31 | + if(!(\App::environment('local'))) { |
|
| 32 | + URL::forceScheme('https'); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | } |