for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\FortySixElks;
use GuzzleHttp\Client;
use NotificationChannels\FortySixElks\Exceptions\MissingConfigNotification;
class FortySixElksMedia
{
/**
* @var string
*/
const ENDPOINT = null;
* @var array
protected $payload = [
'lines' => [],
];
* @var int
protected $phone_number;
protected $from;
protected $username;
protected $password;
* FortySixElksMedia constructor.
public function __construct()
$this->username = config('services.46elks.username');
$this->password = config('services.46elks.password');
if (!$this->username || !$this->password) {
throw MissingConfigNotification::missingConfig();
}
$this->client = new Client(
client
[
'headers' => [
'Content-Type' => 'application/x-www-urlencoded',
],
'auth' => [
$this->username,
$this->password,
]
);
* @param $line
*
* @return $this
public function line($line)
$this->payload['lines'][] = $line;
return $this;
* @param $phone_number
public function to($phoneNumber)
$this->phone_number = $phoneNumber;
* @param $string
public function from($string)
$this->from = $string;
* @return string
public function getContent()
return implode(PHP_EOL, $this->payload['lines']);