Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/tourify/llms.txt

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

Overview

Events are time-bound activities that belong to a city and optionally to a specific place within that city. Examples include festivals, guided tours, and cultural exhibitions. Authenticated users can register for events and track their registrations.

Browse & filter

List events by city or filter to only upcoming ones using query parameters.

Registration

Register for and cancel attendance at events. Duplicate registrations are safe — firstOrCreate is used.

My registrations

Retrieve all events a user has registered for, sorted by event date ascending.

Reviews & ratings

Events support the same review system as places — see the Reviews page.

Endpoints

GET /api/events

Returns a list of events ordered by date ascending. Both query parameters are optional and can be combined. Query parameters
city_id
integer
Filter events to a specific city. Pass the numeric city ID (e.g. city_id=1).
upcoming
boolean
When true, only events whose date is in the future (after now()) are returned. Accepts true, 1, "true", "1", "on", or "yes".
Each event in the response includes its images, city, and place (nullable).
curl -s "http://localhost:8000/api/events" \
  -H "Accept: application/json"
Response (200)
[
  {
    "id": 7,
    "city_id": 1,
    "place_id": 10,
    "title": "Visita nocturna a la Sagrada Família",
    "description": "Una experiencia única para ver la basílica iluminada de noche.",
    "date": "2025-08-20T21:00:00.000000Z",
    "created_at": "2025-05-01T08:00:00.000000Z",
    "updated_at": "2025-05-01T08:00:00.000000Z",
    "images": [
      { "id": 31, "url": "https://example.com/storage/events/nocturna.jpg" }
    ],
    "city": { "id": 1, "name": "Barcelona" },
    "place": { "id": 10, "name": "Sagrada Família" }
  }
]

GET /api/events/

Returns a single event with full detail. This endpoint works for both authenticated and unauthenticated users, but the is_registered field is resolved differently depending on authentication state. Response fields
images
array
All images associated with the event via the polymorphic imageable relationship.
city
object
The city the event is held in.
place
object | null
The specific place the event is held at. null if the event is not tied to a specific place.
reviews
array
All reviews for this event, each including the user who wrote it.
registrations_count
integer
Total number of users who have registered for this event.
is_registered
boolean
Whether the currently authenticated user has registered for this event. Always false for unauthenticated requests.
is_registered uses the auth:sanctum guard in optional mode — the endpoint is publicly accessible, but if a valid Authorization: Bearer token is present the field reflects the user’s actual registration status. Unauthenticated requests always receive is_registered: false.
curl -s http://localhost:8000/api/events/7 \
  -H "Accept: application/json"

POST /api/events//register

Register the authenticated user for an event. Uses firstOrCreate — calling this endpoint on an already-registered event is idempotent and will not create a duplicate record. Requires authentication.
curl -s -X POST http://localhost:8000/api/events/7/register \
  -H "Accept: application/json" \
  -H "Authorization: Bearer 15|xYzAbCdEfGhIjKlMnOpQrStUvWx0987654321"

DELETE /api/events//register

Cancel the authenticated user’s registration for an event. If the user was not registered, the response is still 200 with the cancellation message. Requires authentication.
curl -s -X DELETE http://localhost:8000/api/events/7/register \
  -H "Accept: application/json" \
  -H "Authorization: Bearer 15|xYzAbCdEfGhIjKlMnOpQrStUvWx0987654321"

GET /api/my/registrations

Returns all event registrations belonging to the authenticated user, sorted by event date ascending. Each registration includes the full event object with its city, place, and images. Requires authentication.
curl -s http://localhost:8000/api/my/registrations \
  -H "Accept: application/json" \
  -H "Authorization: Bearer 15|xYzAbCdEfGhIjKlMnOpQrStUvWx0987654321"

Event registration flow

1

Browse events

Call GET /api/events?upcoming=true (or filter by city_id) to display a list of upcoming events.
2

View event detail

Call GET /api/events/{event} with the user’s token. The is_registered field indicates whether the user is already attending.
3

Register

If is_registered is false, call POST /api/events/{event}/register. The response includes the registration record with the event nested.
4

Cancel

If the user wants to cancel, call DELETE /api/events/{event}/register.
5

View my schedule

Call GET /api/my/registrations to show the user a date-sorted list of all events they have signed up for.

Build docs developers (and LLMs) love