The event object
Every successful response involving a single event — or each element in an array response — returns an event object with the following fields.integer
Auto-incremented primary key uniquely identifying the event.
integer | null
Foreign key referencing the
users table. Identifies the user who owns or created the event. null if no user is assigned (set to null on user deletion).integer | null
Foreign key referencing the
statuses table. Defaults to 1 (Disponible) on creation. Set to null on status deletion.integer | null
Foreign key referencing the
locations table. Set to null on location deletion.integer | null
Foreign key referencing the
categories table. Set to null on category deletion.string
Display name of the event. Maximum 255 characters.
string
Full text description of the event.
string
URL pointing to the event’s cover image. Stored as a non-nullable string in the database; pass an empty string if no image URL is available.
integer
Total number of attendee spots available for the event.
integer
Current number of confirmed attendees. Defaults to
0 at creation and is incremented by the system as tickets are issued.integer
Ticket price for the event (stored as an integer, representing the smallest currency unit or whole currency amount depending on your locale).
datetime
ISO 8601 datetime string indicating when the event begins.
datetime
ISO 8601 datetime string indicating when the event ends. Always on or after
start_date.datetime
ISO 8601 datetime string set automatically when the record is first created.
datetime
ISO 8601 datetime string updated automatically whenever the record is modified.
object
Eager-loaded category object (
id, name, created_at, updated_at). Present on index and show responses.object
Eager-loaded location object (
id, address, city, region, country, latitude, longitude, created_at, updated_at). Present on index and show responses.object
Eager-loaded user object. Present on
index and show responses.object
Eager-loaded status object (
id, name, created_at, updated_at). Present on index and show responses.GET /api/event
Returns an array of all events in the database. Each event object includes the fully eager-loadedcategory, location, user, and status relations so that you do not need to make additional requests to resolve associated records.
[] with status 200 when no events exist.
GET /api/event/{id}
Returns a single event identified by its integerid, with all relations eager-loaded.
Path parameter
integer
required
The unique identifier of the event to retrieve.
POST /api/event
Creates a new event record. The request body must be JSON or form-encoded and pass all required field validations. On success the newly created event is returned with HTTP201 Created. The attendees field is not accepted as input — it starts at 0 and is managed by the system.
Request body
string
required
Display name of the event. Maximum 255 characters.
string
required
Full text description of the event.
integer
required
Total number of available attendee spots.
integer
required
Ticket price for the event.
date
required
Event start date/time. Must be a valid date string parseable by PHP (e.g.
2024-09-15 or 2024-09-15T09:00:00).date
required
Event end date/time. Must be a valid date on or after
start_date.integer
required
ID of an existing category from the
categories table.integer
required
ID of an existing location from the
locations table.integer
required
ID of an existing status from the
statuses table.integer
Optional. ID of an existing user to associate with the event. May be omitted or explicitly sent as
null.string
Optional. URL string for the event’s cover image. May be omitted or explicitly sent as
null.The
store response returns the raw event model without eager-loaded relations. Call GET /api/event/{id} if you need the full relational payload immediately after creation.PUT /api/event/{id}
Updates an existing event. All body fields are optional — only the fields you include will be changed. Any field you do provide is still subject to the same validation rules as on creation. Path parameterinteger
required
The unique identifier of the event to update.
string
New display name. Maximum 255 characters.
string
New description text.
integer
Updated total capacity.
integer
Updated ticket price.
date
Updated start date/time.
date
Updated end date/time. Must be on or after
start_date when provided.integer
ID of the new category. Must exist in the
categories table.integer
ID of the new location. Must exist in the
locations table.integer
ID of the new status. Must exist in the
statuses table.integer
ID of the new owning user. May be
null.string
New cover image URL. May be
null.DELETE /api/event/{id}
Permanently deletes the event with the given ID. The underlying database record uses soft-deletes (thedeleted_at column from the migration), so deleted rows are retained at the database level but excluded from all queries.
Path parameter
integer
required
The unique identifier of the event to delete.