Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.
This repository was archived by the owner on May 20, 2026. It is now read-only.

Query DB on Event::listen #30

@Kiszko

Description

@Kiszko

Firstly, and unrelated - when I console log a msg I get 2 logs, eg.

app.BrainSocket.Event.listen('some.event', function(msg)
{
    console.log(msg);
});

returns 2 objects in console when the event if fired - surely it should just return 1.

Secondly, is it possible to query the session or even the db in the Event::listen handler? eg.

Event::listen('some.event', function($client_data)
{
    // Query db - User::find(1)
    return BrainSocket::message('some.event', ['message' => 'foooozer']);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions