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.

Reviews allow authenticated users to rate places and events on a 1–5 star scale with an optional written comment. The API enforces one review per user per item — submitting a second review updates the existing record. Computed average ratings are exposed directly on the place and event endpoints.
Average ratings computed from reviews are returned on the place and event list and detail endpoints — you do not need to calculate them client-side.

POST /api/places//reviews

Submits a star rating and optional comment for a place. Because the endpoint uses updateOrCreate, submitting a second review for the same place simply updates the existing record rather than creating a duplicate. Returns HTTP 201 for both new and updated reviews.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).

Path Parameters

place
integer
required
The ID of the place being reviewed.

Request Body

rating
integer
required
Star rating for the place. Must be an integer between 1 and 5 (inclusive).
comment
string
Optional written review. Maximum 1000 characters.

Response Fields

id
integer
Unique identifier of the review record.
user_id
integer
ID of the user who submitted the review.
reviewable_id
integer
ID of the reviewed item (the place ID).
reviewable_type
string
Morph type string for the reviewed item. Value: place.
rating
integer
The submitted star rating (1–5).
comment
string | null
The submitted comment, or null if none was provided.
user
object
The user who authored the review.
created_at
string (ISO 8601)
Timestamp when the review was first created.
updated_at
string (ISO 8601)
Timestamp when the review was last updated. Will differ from created_at on repeat submissions.
Example request
curl -X POST http://localhost:8000/api/places/5/reviews \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}" \
  -H "Content-Type: application/json" \
  -d '{"rating": 4, "comment": "Beautiful spot with great views."}'

POST /api/events//reviews

Submits a star rating and optional comment for an event. Like the place review endpoint, repeat submissions update the existing review rather than creating a new one. Returns HTTP 201 for both new and updated reviews.
This endpoint requires authentication. Include your bearer token in the Authorization header.
Authentication: Required (auth:sanctum).

Path Parameters

event
integer
required
The ID of the event being reviewed.

Request Body

rating
integer
required
Star rating for the event. Must be an integer between 1 and 5 (inclusive).
comment
string
Optional written review. Maximum 1000 characters.

Response Fields

id
integer
Unique identifier of the review record.
user_id
integer
ID of the user who submitted the review.
reviewable_id
integer
ID of the reviewed item (the event ID).
reviewable_type
string
Morph type string for the reviewed item. Value: event.
rating
integer
The submitted star rating (1–5).
comment
string | null
The submitted comment, or null if none was provided.
user
object
The user who authored the review.
created_at
string (ISO 8601)
Timestamp when the review was first created.
updated_at
string (ISO 8601)
Timestamp when the review was last updated.
Example request
curl -X POST http://localhost:8000/api/events/12/reviews \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {your-token}" \
  -H "Content-Type: application/json" \
  -d '{"rating": 5, "comment": "One of the best local festivals I have attended."}'

Build docs developers (and LLMs) love