- Installation
- Example
- Method
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]
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
}
create a new number check, the method will return us the number to call within 5 minutes
$phone string = 79095001010;
$call->phone($phone);
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