47 lines
944 B
PHP
47 lines
944 B
PHP
|
<?php
|
||
|
|
||
|
|
||
|
namespace App\Services;
|
||
|
|
||
|
|
||
|
use App\Traits\ConsumesExternalService;
|
||
|
|
||
|
class NotificationService
|
||
|
{
|
||
|
use ConsumesExternalService;
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
public $baseUri ;
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
public $key ;
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->baseUri = config('services.notification_service.base_uri');
|
||
|
$this->key = config('services.notification_service.key');
|
||
|
}
|
||
|
|
||
|
public function post($uri , $data, $headers)
|
||
|
{
|
||
|
return $this->perfomRequest('POST',$uri,$data,$headers);
|
||
|
}
|
||
|
|
||
|
public function get($uri , $data, $headers)
|
||
|
{
|
||
|
return $this->perfomRequest('GET',$uri,$data,$headers);
|
||
|
}
|
||
|
|
||
|
public function put($uri , $data, $headers)
|
||
|
{
|
||
|
return $this->perfomRequest('PUT',$uri,$data,$headers);
|
||
|
}
|
||
|
|
||
|
public function delete($uri , $data, $headers)
|
||
|
{
|
||
|
return $this->perfomRequest('DELETE',$uri,$data,$headers);
|
||
|
}
|
||
|
}
|