Skip to content

Commit

Permalink
chore: Update example with new lead creation
Browse files Browse the repository at this point in the history
Update the example for creating leads with products and variants.
  • Loading branch information
LuukvH committed Feb 9, 2024
1 parent 8aaa4e3 commit be9fd70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require __DIR__ . '/vendor/autoload.php';

$access_token = 'GUFBU8ZDGRFiX5q-Xt8nzwSuO6VzXb6zBM_IVHQqQd_Y4pAnjT6PtKkU324OROqt'; # testing program builder key
$access_token = '<ACCESS_TOKEN>'; # testing program builder key

$connection = new Eduframe\Connection();

Expand All @@ -14,10 +14,10 @@
$data = [];

// With include its possible to include nested relations.
$data['products'] = $client->catalog_products()->all(['include' => 'labels']);
$data['variants'] = $client->catalog_variants()->get();

// To get teachers pass the correct role
$data['teachers'] = $client->teachers()->all();
$data['teachers'] = $client->teachers()->get();

// Create a new lead
$lead = $client->leads();
Expand All @@ -32,9 +32,9 @@
'city' => 'Eindhoven',
'country' => 'NL',
]);
$lead->courses_leads = [$client->lead_interests([
"course_id" => 133,
"planned_course_id" => null
$lead->lead_products = [$client->lead_products([
"catalog_product_id" => 123,
"catalog_variant_id" => 456,
])];

$lead->save();
Expand Down

0 comments on commit be9fd70

Please sign in to comment.