Event

View the Events of your Models from the Event Sourcing feature.

Table name: events

Description: Storing events information of your models.

To follow the best practice of Event Sourcing, please always do these:

  • Append-only

  • Avoid updating the existing record as much as possible

Model

use SaasReady\Models\Events;

Response Entity

type Event = {
    uuid: string;
    name: string;
    category: string;
    properties: array;
    activated_at: string;
    created_at: string;
    updated_at: string;
    
    model: Model;
    user?: User | null;
}

Endpoints

[GET] saas/events

Get a list of Events of a Model

Request payload:

{
    limit: int; // required
    page: int; // required
    source_type: string; // required: the class of your instance eg: App/Models/User
    source_id: int; // required: your instance id
    user_id?: int; // optional: filter by user_id - null by default
    load_related_model?: boolean; // optional: load "model" relationship, false by default
}

Response payload:

{
    data: Event[],
}

[GET] saas/events/{eventUuid}

Get single Event

Request payload:

{
    load_related_model?: boolean; // optional: load "model" relationship, false by default
}

Response payload:

{
    data: Event,
}

Last updated