Download the PHP package bfg/web-hooker without Composer
On this page you can find all versions of the php package bfg/web-hooker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package web-hooker
Extension web-hooker
Install
Description
Compact Laravel WebHook core for simple of begin
Usage
Importantly! You should have queues for processing hooks.
Publish
Migrations
Configs
Migrate
A mandatory stage is to create a table in the database, so after the publication of migration, will launch them.
Http request type
You need to make sure that the
type.http_request
setting is included in theconfig/webhooker.php
file in thetrue
value.
Before usage, you should use the trait on your model there you want to use for hooks:
Create your own event, which is a standard Laravel functionality.
In the construct of your event, you can accept the Hook model and a payload.
Create the organizer class by using the Bfg\WebHooker\WebHookOrganizerInterface
interface:
Or you can use the command for create a organizer:
For get a request link for hook, you can use the $hook->route_response
parameter.
You can now create bridges for some separate entry in the database or model.
or
If you want to postpone the signature for some time,
you can use the subscribeDelay
method:
If you want to indicate the time of the unsubscribing,
you can also indicate through the unsubscribeDelay
method:
To launch subscription and unsubscribing procedures,
you need to configure your schedule on the webhook:associate
command with an interval of one minute:
Open signature type
You need to make sure that the
type.websocket_open_signature
setting is included in theconfig/webhooker.php
file in thetrue
value.
If you install a beyondcode/laravel-websockets
package,
you have the opportunity to create fast hooks that
can take data on the socket.
What you need to use this type:
Create the organizer:
Create the special bridge:
Server:
Client:
Open client type
You need to make sure that the
type.websocket_open_client
setting is included in theconfig/webhooker.php
file in thetrue
value.
This type is designed as a client that creates local client connections with asynchronous TCPs (web socket servers).
Create the organizer:
Carefully study how the organizer is built, without it the client’s server will ignore this hook
After the link to the server is indicated, you can customize your organizer a little:
In order to prepare your payload, you can declare the preparePayload
method in your organizer:
Create the special bridge:
Run the server of client connection
Supervisor