Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
/ callphone Public archive

Laravel/Lumen Call Phone - Проверка номера телефона с помощью звонка SMS.RU

License

Notifications You must be signed in to change notification settings

tioffs/callphone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel/Lumen Call Phone - Проверка номера телефона с помощью звонка SMS.RU License

Downloads

Installation

Using Composer:

composer require tioffs/callphone

Laravel config app.php

'callphone' => ['api_key' => env('SMSRU_API_KEY', null)]

lumen config app.php

config(['callphone' => ['api_key' => env('SMSRU_API_KEY', null)]);

Registre Service Provider:

  • lumen $app->register(callphone\CallServiceProvider::class);
  • laravel config/app.php providers => [callphone\CallServiceProvider::class]

Example

Route::get('/call', function(Illuminate\Http\Request $request, callphone\Call $call){
     $phone = $call->phone($request->phone);
     return response()->json($phone);
});

/** response: **/
{
    "check_status":null,
    "status_code":100,
    "check_id":2222-3333,
    "call_phone":+79095001010,
    "error":null,
    "call_phone_pretty":null
}

Method

Get call phone

create a new number check, the method will return us the number to call within 5 minutes

$phone string = 79095001010;
$call->phone($phone);

Check status

Method for checking the call status

$check_id string = $call->phone("79095001010")->check_id;
$call->check($check_id);
if ($call->check_status === 401) {
    /** the user called the number, the number is confirmed **/
}

Made with ♥ from the @tioffs

About

Laravel/Lumen Call Phone - Проверка номера телефона с помощью звонка SMS.RU

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages