for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Resova\Endpoints;
use Resova\Client;
use Resova\Models\Customer;
class Customers extends Client
{
/**
* @var string
*/
protected $namespace = __CLASS__;
* Create a customer
* Creates a new customer object.
*
* @param Customer $customer
* @return $this
public function create(Customer $customer): self
$customer->setRequired([
'first_name',
'last_name',
'email',
]);
// Set HTTP params
$this->type = 'post';
$this->endpoint = '/customers';
$this->params = $customer;
$this->response = Customer::class;
response
return $this;
}
* Retrieve a customer
* Retrieves the details of a customer. Provide the unique id for the customer.
* @param int $customer_id The customer id
public function __invoke(int $customer_id): self
$this->customer_id = $customer_id;
customer_id
$this->type = 'get';
$this->endpoint = '/customers/' . $customer_id;
public function update(Customer $customer): self
$this->type = 'put';