TheDocumentation 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.
Appointment model is the core of the AR Barbería booking system. Each record represents a single booking made by a customer, linked to a specific barber (User) and optionally tagged with one or more Service records. Appointments use soft deletes, meaning a cancellation sets deleted_at rather than removing the row — historical booking data is always preserved.
Fields
Auto-incrementing primary key.
Full name of the customer as entered in the booking form.
Customer contact number. Must be exactly 10 digits. Validated at the controller layer before the record is stored.
The requested service type. Added in the April 2026 migration with a default of
'corte'. Accepted values are:corte— haircut only (30 minutes)barba— beard trim only (30 minutes)ambos— haircut and beard trim (60 minutes)
The date and time the appointment begins. Stored in the database as a datetime column. Slot options are driven by the barber’s Workday schedule in 30-minute increments.
The date and time the appointment ends. This value is computed from
starts_at plus the duration implied by servicio: 30 minutes for corte or barba, 60 minutes for ambos. Added in the second migration.Current status of the appointment. The database enforces an ENUM with three allowed values:
pending— appointment is booked and awaiting service (default)completed— service has been deliveredcancelled— appointment was cancelled
Foreign key referencing the
users table. Identifies which barber the appointment is booked with.Timestamp set automatically by Laravel when the record is created.
Timestamp updated automatically by Laravel on every save.
Populated when the appointment is soft-deleted (cancelled). While this field is set, the record is excluded from standard queries. The physical row is never removed. Added in the third migration.
Relations
user() — belongsTo User
Each appointment belongs to one barber. The user_id foreign key points to the users table.
services() — belongsToMany Service
Appointments can be tagged with one or more Service records via the appointment_service pivot table.
The current booking flow stores the service type in the
servicio string field (corte, barba, ambos) and does not attach records to the services many-to-many relation. The services() relation and appointment_service pivot table are available for future use when a richer service catalogue is needed.Soft delete behavior
The model uses Laravel’sSoftDeletes trait. Cancelling an appointment writes the current timestamp to deleted_at. The record remains in the database and is accessible via:
Appointment::all()) automatically exclude rows where deleted_at is not null.