tioffs / callphone
This package is abandoned and no longer maintained.
No replacement package was suggested.
Авторизация на сайте с помощью звонка
dev-master
2021-12-02 04:33 UTC
Requires
- php: >=7.0
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2023-03-01 00:18:11 UTC
README
- Installation
- Example
- Method
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