File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,37 @@ curl -X POST "https://example.com/webhooks/signal/order-workflow/1/mark-as-shipp
81
81
-H " Content-Type: application/json"
82
82
```
83
83
84
+ ## Webhook URL Helper
85
+ The ` $this->webhookUrl() ` helper generates webhook URLs for starting workflows or sending signals.
86
+
87
+ ```
88
+ $activity->webhookUrl();
89
+ $activity->webhookUrl('signalMethod');
90
+ ```
91
+
92
+ Parameters
93
+ - string $signalMethod = '' (optional)
94
+
95
+ If empty, returns the URL for starting the workflow.
96
+
97
+ If provided, returns the URL for sending a signal to an active workflow instance.
98
+
99
+ ```
100
+ use Workflow\Activity;
101
+
102
+ class ShipOrderActivity extends Activity
103
+ {
104
+ public function execute(string $email, StoredWorkflow $storedWorkflow): void
105
+ {
106
+ $startUrl = $this->webhookUrl();
107
+ // $startUrl = '/webhooks/start/order-workflow';
108
+
109
+ $signalUrl = $this->webhookUrl('markAsShipped');
110
+ // $signalUrl = '/webhooks/signal/order-workflow/{workflowId}/mark-as-shipped';
111
+ }
112
+ }
113
+ ```
114
+
84
115
## Webhook Authentication
85
116
By default, webhooks don't require authentication but this can be configured in ` config/workflows.php ` .
86
117
You can’t perform that action at this time.
0 commit comments