Customers can now be created

This commit is contained in:
mathiaspalmqvist committed 2025-06-30 11:24:20 +02:00
1 parent 27ddeeacb5
commit 0802d5cac2
5 files changed
+140

No files matched your search

+8
View File
@@ -3,6 +3,7 @@
namespace Mattitja\BokioApiLaravel\Resources;
use Mattitja\BokioApiLaravel\BokioClient;
use Mattitja\BokioApiLaravel\Validation\CustomerValidator;
class Customer
{
@@ -32,4 +33,11 @@ class Customer
{
return $this->client->get('customers/'.$customerId);
}
public function create(array $data): object
{
$validated = CustomerValidator::validate($data);
return $this->client->post('customers', $validated);
}
}