How can I get the entity ID after saving it?
Use $CustomerEntity-&gt;id(); after saving your entity.
$CustomerEntity = CustomerEntity::create([
  'customer_id' =&gt; $customer['id'],
  'customer_name' =&gt; $customer['name'],
  'address' =&gt; $customer['address'],
]);

$CustomerEntity-&gt;save();
$id = $CustomerEntity-&gt;id();