update api register

This commit is contained in:
Wian Drs
2026-08-01 11:42:42 +07:00
parent b0d08211ec
commit 75342dc7b7
55 changed files with 2254 additions and 35 deletions
+12
View File
@@ -100,6 +100,18 @@ class CustomerService
'registration',
['action_url' => "/customers/orders/{$customer->id}/detail"],
);
User::query()
->whereHas('userTenants', fn ($query) => $query
->where('tenant_id', $customer->tenant_id)
->where('role', 'tenant_owner'))
->each(fn (User $owner) => $this->notifications->emit(
'customer.registration',
$owner,
$customer,
['customer' => $customer->toArray(), 'tenant' => $customer->tenant?->toArray() ?? []],
'registration',
['action_url' => "/customers/orders/{$customer->id}/detail", 'icon' => 'cil-user-follow'],
));
return $customer->load(self::DETAIL_RELATIONS);
}