A Laravel Package To Validate A Ghana Phone Number and Also Return the network the phone number belongs to.
Via Composer
$ composer require ambrosethebuild/ghanaphonenumbervalidator
If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:
AmbroseTheBuild\GhanaPhoneNumberValidator\GhanaPhoneNumberValidatorServiceProvider::class
use AmbroseTheBuild\GhanaPhoneNumberValidator\GhanaPhoneNumberValidator;
class ViewController extends Controller
{
//
public function ghana_phone_validator( Request $request ){
//method takes phone number
return GhanaPhoneNumberValidator::isValidGhanaNumber( $request->number );
return GhanaPhoneNumberValidator::whichNetwork( $request->number );
}
}
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
The MIT License (MIT). Please see the license file for more information.