PHP code example of tapfury / laravel-phone

1. Go to this page and download the library: Download tapfury/laravel-phone library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tapfury / laravel-phone example snippets


'providers' => [
    ...
    Propaganistas\LaravelPhone\LaravelPhoneServiceProvider::class,
],

"phone" => "The :attribute field contains an invalid number.",

$app->register(Propaganistas\LaravelPhone\LaravelPhoneServiceProvider::class);

    'phonefield'  => 'phone:US,BE',
    

    'phonefield'            => 'phone',
    'phonefield_country'    => '

    'phonefield'            => 'phone:custom_country_field',
    'custom_country_field'  => '

    Country::all()
    

    'phonefield'  => 'phone:AUTO,US',
    

'phonefield'  => 'phone:US,BE,mobile',

'phonefield'  => 'phone:LENIENT,US',

phone($phone_number, $country_code = null, $format = PhoneNumberFormat::INTERNATIONAL)