added automation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Automation;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AutomationEvents
|
||||
{
|
||||
public static function fire(string $event, int $customerId): void
|
||||
{
|
||||
if ($customerId <= 0 || $event === '') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
app(AutomationEngine::class)->onCustomerEvent($event, $customerId);
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('Automation event failed', [
|
||||
'event' => $event,
|
||||
'customer_id' => $customerId,
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user