Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/OswalSnow/AR-Barber/llms.txt

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

AR Barbería provides three JSON endpoints: one public availability endpoint used by the customer booking flow and two authenticated staff endpoints for schedule inspection and appointment listing. All responses use Content-Type: application/json. The public endpoint requires no credentials; the staff endpoints require a valid Laravel Breeze session cookie.

GET /api/disponibilidad/{user_id}/{fecha}

Returns the list of available appointment start times for a specific barber on a specific date. This is the primary endpoint consumed by the booking form’s time-slot picker. Authentication: None required.

Path parameters

user_id
integer
required
The ID of the barber (users.id where role = 'barber').
fecha
string
required
The date to check in YYYY-MM-DD format, e.g. 2026-06-15.

Query parameters

duration
integer
default:"30"
Desired appointment duration in minutes. The endpoint generates slots in 30-minute increments and excludes any slot that cannot fully accommodate this duration before the end of the workday. Defaults to 30.

Response

[]
string[]
An ordered array of available start times in HH:MM 24-hour format. Returns an empty array when:
  • The barber has no workday record configured for fecha.
  • The workday is marked as closed (is_open = false).
  • All slots within the workday are occupied by existing appointments.
  • The requested date is today and all remaining slots are in the past.
["10:00", "10:30", "11:00", "14:30", "15:00"]
Empty response:
[]

Slot generation logic

Slots are produced in 30-minute increments between start_time and end_time as configured on the barber’s workday record. For today’s date, slots whose start time is earlier than the current time are excluded. Any slot that overlaps with an existing appointment is also excluded.

Example request

curl "https://example.com/api/disponibilidad/3/2026-06-15?duration=60"
Use duration=60 when the customer selects the ambos (haircut + beard) service, as it typically takes a full hour. Pass duration=30 for corte or barba individually.

GET /staff/availability

Returns the complete slot grid for a barber on a given date, including both available and occupied slots. Intended for staff dashboards where a barber needs to see their entire schedule, not just the free slots. Authentication: Requires an authenticated session (auth middleware). Include the laravel_session cookie obtained after logging in via POST /login.
Requests without a valid session cookie receive a 302 Found redirect to /login, not a JSON error response. Ensure your client follows redirects or detects the 302 and re-authenticates before retrying.

Query parameters

barber_id
integer
required
The ID of the barber whose schedule to retrieve.
date
string
required
The date to inspect in YYYY-MM-DD format.

Response

slots
object[]
Array of slot objects spanning the full workday.
{
  "slots": [
    { "time": "09:00", "available": false, "status": "occupied" },
    { "time": "09:30", "available": false, "status": "occupied" },
    { "time": "10:00", "available": true,  "status": "available" },
    { "time": "10:30", "available": true,  "status": "available" },
    { "time": "11:00", "available": false, "status": "occupied" }
  ]
}

Example request

curl "https://example.com/staff/availability?barber_id=3&date=2026-06-15" \
  --cookie "laravel_session=YOUR_SESSION_COOKIE"

GET /staff/appointments

Returns all appointments for the authenticated barber’s schedule on a given date. Used by staff to review and manage their day’s bookings. Authentication: Requires an authenticated session (auth middleware).

Query parameters

date
string
default:"today"
The date to query in YYYY-MM-DD format. Defaults to today’s date when omitted.

Response

[]
object[]
Array of Appointment objects. Returns an empty array when no appointments exist for the given date.
[
  {
    "id": 42,
    "customer_name": "Carlos Méndez",
    "customer_phone": "5512345678",
    "servicio": "ambos",
    "starts_at": "2026-06-15T10:00:00",
    "ends_at": "2026-06-15T11:00:00",
    "status": "pending",
    "user_id": 3
  },
  {
    "id": 43,
    "customer_name": "Luis Ramírez",
    "customer_phone": "5598765432",
    "servicio": "corte",
    "starts_at": "2026-06-15T11:30:00",
    "ends_at": "2026-06-15T12:00:00",
    "status": "pending",
    "user_id": 3
  }
]

Example request

curl "https://example.com/staff/appointments?date=2026-06-15" \
  --cookie "laravel_session=YOUR_SESSION_COOKIE"
Omit the date parameter to retrieve today’s appointment list without constructing a date string — useful for dashboard widgets that load on page open.

Build docs developers (and LLMs) love