Request
Retrieving the request parameters
Any request POST parameter
$this->request()->input('name_of_the_input');
For POST parameters, the request method can be used directly:
$this->request('name_of_the_input');
// Equivalent to
$this->request()->input('name_of_the_input');
Any request GET parameter
$this->request()->query('name_of_the_input');
While this two methods are useful, Rejoice has helper methods for some of the parameters:
The phone number of the user
$this->tel();
// or
$this->msisdn();
The network
$this->network();
This returns the MNC of the user, not the network name.
The session ID
$this->sessionId();
The session ID is retrieved from the mobile operator.
The request type (a.k.a service operator code)
$this->ussdRequestType();
The user’s response (a.k.a USSD string)
$this->userResponse();
The channel
Useful when building an application not only for USSD. You can do extra stuff, customize the response, etc., based on the channel.
$this->channel(); // Will be USSD by default.