- version 3.6
Check those constraints:
$this->anything()
| <?php | |
| $kra_regex = "/^[A]{1}[0-9]{9}[a-zA-Z]{1}$/"; | |
| $kra_pin = "A001234567J"; | |
| if(preg_match($kra_regex, $kra_pin)){ | |
| echo "Success! Valid KRA PIN"; | |
| } | |
| else{ | |
| echo "Error! Invalid KRA PIN"; | |
| } |
| Usefull manual how to config with MS Code: https://medium.com/full-stack-development/laradock-xdebug-ms-code-no-problem-35a4338deb3f | |
| Out-dated but partial helpfull phpstorm configs https://laradock.io/guides/#phpstorm-settings |
| <?php | |
| // include Faker in your project (https://github.com/fzaninotto/Faker#installation) | |
| use Faker\Factory as Faker; | |
| $faker = Faker::create(); | |
| $regex = "/(\+?254|0){1}[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}/"; | |
| $samplePhoneNumber = $faker->regexify($regex); |
| # KE | |
| SAFARICOM: "/(\+?254|0|^){1}[-. ]?[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}\z/" | |
| AIRTEL: "/(\+254|0|^){1}[-. ]?[7]{1}([3]{1}[0-9]{1}|[8]{1}[5-9])[0-9]{6}\z/" | |
| # TZ | |
| TIGO: "/(\+?255|0|^){1}[-. ]?([7]{1}[1]{1}[2-9]{1}|[6]{1}[57]{1}[2-9]{1})[0-9]{6}\z/" |
| <?php //FILE: sms_api.php | |
| function sendSMS($number, $message) { | |
| $url = "example"; // Set your frontlinesms or frontlinecloud webconnection url here | |
| $secret = "secret"; // Set the secret here | |
| $request = array( | |
| 'secret' => $secret, | |
| 'message' => $message, | |
| 'recipients' => array(array( |