Pushable
trait Pushable
The Pushable provides a simple mechanic for pushing an item into the web socket server's pusher.
Methods
Set default pushable options for model, uses an array with the keys
- category - string socket category user is subscribed to
- related - array of related properties to include when serializing
Example:
class Content extends BaseModel { use Pushable; .
Push the model to the web socket server via the queue service Options are set as keyword arguments in the form of
- category - (string) supplemental category
- options - (array) override options, see setPushableOptions for more info
Details
at line line 44
setPushableOptions(array $opts = array())
Set default pushable options for model, uses an array with the keys
- category - string socket category user is subscribed to
- related - array of related properties to include when serializing
Example:
class Content extends BaseModel { use Pushable; ... $this->setPushableOptions([ 'category' => 'contentupdate', 'related' => [ 'export', 'authors', 'tags', 'assignment', 'attachment', 'audit', 'export', 'dominantAttachment' ] ] }
at line line 58
pushToSocket(array $kwargs = array())
Push the model to the web socket server via the queue service Options are set as keyword arguments in the form of
- category - (string) supplemental category
- options - (array) override options, see setPushableOptions for more info