ok
Direktori : /home2/selectio/www/3-idiots/vendor/seshac/laravel-shiprocket-api/src/Resources/ |
Current File : /home2/selectio/www/3-idiots/vendor/seshac/laravel-shiprocket-api/src/Resources/Resource.php |
<?php namespace Seshac\Shiprocket\Resources; use Seshac\Shiprocket\Clients\Client; abstract class Resource implements ResourceInterface { protected $client; protected $token; public function __construct(Client $client, string $token) { $this->client = $client; $this->token = $token; } public function getRequest(string $endpoint) { return $this->client->setEndpoint($endpoint) ->setHeaders($this->token) ->get(); } public function postRequest(string $endpoint, array $params) { return $this->client->setEndpoint($endpoint) ->setHeaders($this->token) ->post($params); } public function patchRequest(string $endpoint, array $params) { return $this->client->setEndpoint($endpoint) ->setHeaders($this->token) ->patch($params); } }