pushToConnector()
pushToConnector( $kwargs = array())
Push items to connected front end
Parameters
$kwargs |
Connectable pushes CEO data to connected front end. A connectable item is pushed into the queue then exported and pushed to a specified endpoint.
Using a JWT to confirm transmission authority, you can manage remote content automatically for a connected frontend.
As of CEO 1.5 connectable items must be manually pushed using the Connectable trait
and the pushToConnector
method.
Connectable expects a configuration key with an encryption key (for the JWT) and a JSON endpoint:
'client' => [
'publication' => 'The State News',
'site' => 'http://statenews.com',
'connector' => [
'key' => 'mysecretkey',
'url' => 'https://some.tld/path/to/endpoint',
]
],
JWT will be provided as a Bearer token and will contain the the claims:
HTTP Method will be POST and body will contain JSON encoded connected object.
You may provide a custom filter by overloading the connectableCallback
method in your
model and returning false
to stop the connector from firing.