-
Notifications
You must be signed in to change notification settings - Fork 36
Docs ‐ Response
Isaac Sai edited this page Jan 20, 2024
·
1 revision
Various USSD providers have different APIs to communicate with them. Responses provider you with the flexibility to write your application without worry about the response as part of the core of your application.
php artisan ussd:response AfricasTalkingResponse
<?php
namespace App\Ussd\Responses;
use Sparors\Ussd\Contracts\Response;
class AfricasTalkingResponse implements Response
{
public function respond(string $message, bool $terminating): mixed
{
return response(
($terminating ? 'END' : 'CON') . ' ' . $message,
200,
['Content-Type' => 'text/plain']
);
}
}