You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package primarily provides an event_log functionality for logging HTTP requests and model events. It also provides a connector to send those events to Azure Event Hub, but you need to process them by yourself in the packages.
-**`(new AzureEventHubAction())->send(EventLog $eventLog): void`**: Sends a single `CodebarAg\LaravelAzureEventHub\Models\EventLog` to Azure Event Hub using the REST API. The payload is the model's `toArray()` encoded as JSON and sent to `.../messages?api-version=2014-01` with a SAS token in the `Authorization` header. Returns `void`. Recommended to guard calls with `config('laravel-azure-event-hub.enabled')` and to handle idempotency (e.g., `synced_at`) in your job.
155
+
156
+
Minimal usage example:
157
+
158
+
```php
159
+
use CodebarAg\LaravelAzureEventHub\Actions\AzureEventHubAction;
160
+
use CodebarAg\LaravelAzureEventHub\Models\EventLog;
161
+
162
+
// Send one event (instance API)
163
+
(new AzureEventHubAction())->sendEvent($eventLog); // $eventLog is an instance of EventLog
164
+
```
165
+
149
166
#### Example Implementation
150
167
151
168
Create a job to process and send event logs to Azure Event Hub:
@@ -170,7 +187,7 @@ class ProcessAzureEventJob implements ShouldQueue
0 commit comments