Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/eventify-app/llms.txt

Use this file to discover all available pages before exploring further.

Events are the central resource in Eventify. Each event record holds scheduling information (start and end dates), logistics details (capacity, attendee count, price, and location), and classification metadata (category and status). The five endpoints below give you complete control over event data: listing all events with their related records eager-loaded, fetching a single event by ID, creating a new event, updating an existing one, or deleting it permanently.

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.
id
integer
Auto-incremented primary key uniquely identifying the event.
user_id
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).
status_id
integer | null
Foreign key referencing the statuses table. Defaults to 1 (Disponible) on creation. Set to null on status deletion.
location_id
integer | null
Foreign key referencing the locations table. Set to null on location deletion.
category_id
integer | null
Foreign key referencing the categories table. Set to null on category deletion.
name
string
Display name of the event. Maximum 255 characters.
description
string
Full text description of the event.
img_url
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.
capacity
integer
Total number of attendee spots available for the event.
attendees
integer
Current number of confirmed attendees. Defaults to 0 at creation and is incremented by the system as tickets are issued.
price
integer
Ticket price for the event (stored as an integer, representing the smallest currency unit or whole currency amount depending on your locale).
start_date
datetime
ISO 8601 datetime string indicating when the event begins.
end_date
datetime
ISO 8601 datetime string indicating when the event ends. Always on or after start_date.
created_at
datetime
ISO 8601 datetime string set automatically when the record is first created.
updated_at
datetime
ISO 8601 datetime string updated automatically whenever the record is modified.
category
object
Eager-loaded category object (id, name, created_at, updated_at). Present on index and show responses.
location
object
Eager-loaded location object (id, address, city, region, country, latitude, longitude, created_at, updated_at). Present on index and show responses.
user
object
Eager-loaded user object. Present on index and show responses.
status
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-loaded category, location, user, and status relations so that you do not need to make additional requests to resolve associated records.
curl http://localhost:8000/api/event \
  -H "Accept: application/json"
Response — 200 OK
[
  {
    "id": 1,
    "user_id": 2,
    "status_id": 1,
    "location_id": 3,
    "category_id": 1,
    "name": "Tech Summit 2024",
    "description": "Annual technology conference covering the latest industry trends.",
    "img_url": "https://example.com/images/tech-summit.jpg",
    "capacity": 500,
    "attendees": 124,
    "price": 150,
    "start_date": "2024-09-15T09:00:00.000000Z",
    "end_date": "2024-09-17T18:00:00.000000Z",
    "created_at": "2024-05-10T14:23:00.000000Z",
    "updated_at": "2024-05-10T14:23:00.000000Z",
    "category": {
      "id": 1,
      "name": "Technology",
      "created_at": "2024-05-01T00:00:00.000000Z",
      "updated_at": "2024-05-01T00:00:00.000000Z"
    },
    "location": {
      "id": 3,
      "address": "123 Main St",
      "city": "Madrid",
      "region": "Community of Madrid",
      "country": "Spain",
      "latitude": "40.4168000",
      "longitude": "-3.7038000",
      "created_at": "2024-05-01T00:00:00.000000Z",
      "updated_at": "2024-05-01T00:00:00.000000Z"
    },
    "user": {
      "id": 2,
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "status": {
      "id": 1,
      "name": "Disponible",
      "created_at": "2024-05-01T00:00:00.000000Z",
      "updated_at": "2024-05-01T00:00:00.000000Z"
    }
  }
]
Returns an empty array [] with status 200 when no events exist.

GET /api/event/{id}

Returns a single event identified by its integer id, with all relations eager-loaded. Path parameter
id
integer
required
The unique identifier of the event to retrieve.
curl http://localhost:8000/api/event/1 \
  -H "Accept: application/json"
Response — 200 OK
{
  "id": 1,
  "user_id": 2,
  "status_id": 1,
  "location_id": 3,
  "category_id": 1,
  "name": "Tech Summit 2024",
  "description": "Annual technology conference covering the latest industry trends.",
  "img_url": "https://example.com/images/tech-summit.jpg",
  "capacity": 500,
  "attendees": 124,
  "price": 150,
  "start_date": "2024-09-15T09:00:00.000000Z",
  "end_date": "2024-09-17T18:00:00.000000Z",
  "created_at": "2024-05-10T14:23:00.000000Z",
  "updated_at": "2024-05-10T14:23:00.000000Z",
  "category": { "id": 1, "name": "Technology" },
  "location": { "id": 3, "address": "123 Main St", "city": "Madrid", "region": "Community of Madrid", "country": "Spain", "latitude": "40.4168000", "longitude": "-3.7038000" },
  "user": { "id": 2, "name": "Jane Doe", "email": "jane@example.com" },
  "status": { "id": 1, "name": "Disponible" }
}
Error responses
StatusBody
404 Not Found{"message": "Event not found"}

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 HTTP 201 Created. The attendees field is not accepted as input — it starts at 0 and is managed by the system. Request body
name
string
required
Display name of the event. Maximum 255 characters.
description
string
required
Full text description of the event.
capacity
integer
required
Total number of available attendee spots.
price
integer
required
Ticket price for the event.
start_date
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).
end_date
date
required
Event end date/time. Must be a valid date on or after start_date.
category_id
integer
required
ID of an existing category from the categories table.
location_id
integer
required
ID of an existing location from the locations table.
status_id
integer
required
ID of an existing status from the statuses table.
user_id
integer
Optional. ID of an existing user to associate with the event. May be omitted or explicitly sent as null.
img_url
string
Optional. URL string for the event’s cover image. May be omitted or explicitly sent as null.
curl -X POST http://localhost:8000/api/event \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech Summit 2024",
    "description": "Annual technology conference covering the latest industry trends.",
    "capacity": 500,
    "price": 150,
    "start_date": "2024-09-15T09:00:00",
    "end_date": "2024-09-17T18:00:00",
    "category_id": 1,
    "location_id": 3,
    "status_id": 1,
    "user_id": 2,
    "img_url": "https://example.com/images/tech-summit.jpg"
  }'
Response — 201 Created
{
  "id": 5,
  "user_id": 2,
  "status_id": 1,
  "location_id": 3,
  "category_id": 1,
  "name": "Tech Summit 2024",
  "description": "Annual technology conference covering the latest industry trends.",
  "img_url": "https://example.com/images/tech-summit.jpg",
  "capacity": 500,
  "attendees": 0,
  "price": 150,
  "start_date": "2024-09-15T09:00:00.000000Z",
  "end_date": "2024-09-17T18:00:00.000000Z",
  "created_at": "2024-05-20T10:00:00.000000Z",
  "updated_at": "2024-05-20T10:00:00.000000Z"
}
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.
Error responses
StatusBody
422 Unprocessable EntityLaravel validation error object with per-field messages

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 parameter
id
integer
required
The unique identifier of the event to update.
Request body — all fields optional
name
string
New display name. Maximum 255 characters.
description
string
New description text.
capacity
integer
Updated total capacity.
price
integer
Updated ticket price.
start_date
date
Updated start date/time.
end_date
date
Updated end date/time. Must be on or after start_date when provided.
category_id
integer
ID of the new category. Must exist in the categories table.
location_id
integer
ID of the new location. Must exist in the locations table.
status_id
integer
ID of the new status. Must exist in the statuses table.
user_id
integer
ID of the new owning user. May be null.
img_url
string
New cover image URL. May be null.
curl -X PUT http://localhost:8000/api/event/5 \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "capacity": 600,
    "status_id": 2
  }'
Response — 200 OK
{
  "id": 5,
  "user_id": 2,
  "status_id": 2,
  "location_id": 3,
  "category_id": 1,
  "name": "Tech Summit 2024",
  "description": "Annual technology conference covering the latest industry trends.",
  "img_url": "https://example.com/images/tech-summit.jpg",
  "capacity": 600,
  "attendees": 0,
  "price": 150,
  "start_date": "2024-09-15T09:00:00.000000Z",
  "end_date": "2024-09-17T18:00:00.000000Z",
  "created_at": "2024-05-20T10:00:00.000000Z",
  "updated_at": "2024-05-20T11:30:00.000000Z"
}
Error responses
StatusBody
404 Not Found{"message": "Event not found"}
422 Unprocessable EntityLaravel validation error object with per-field messages

DELETE /api/event/{id}

Permanently deletes the event with the given ID. The underlying database record uses soft-deletes (the deleted_at column from the migration), so deleted rows are retained at the database level but excluded from all queries. Path parameter
id
integer
required
The unique identifier of the event to delete.
curl -X DELETE http://localhost:8000/api/event/5 \
  -H "Accept: application/json"
Response — 200 OK
{
  "message": "Event deleted"
}
Error responses
StatusBody
404 Not Found{"message": "Event not found"}
Deletion is irreversible from the API’s perspective. Although soft-delete means the database row is preserved, there is no un-delete endpoint exposed by the API.

Build docs developers (and LLMs) love