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.

The Service model represents a named barbershop service with an associated duration in minutes. Services are linked to appointments through a many-to-many relationship using the appointment_service pivot table. The model is available for a full service catalogue workflow, though the current booking flow uses a simpler servicio string field on the Appointment model directly.

Fields

id
integer
required
Auto-incrementing primary key.
name
string
required
Human-readable service name, for example 'Corte de cabello' or 'Arreglo de barba'.
duration_minutes
integer
required
How long the service takes, in minutes. Used to calculate the ends_at timestamp on an appointment when services are attached via the pivot relation.
created_at
datetime
Timestamp set automatically when the record is created.
updated_at
datetime
Timestamp updated automatically on every save.

Relations

appointments() — belongsToMany Appointment

Services are linked to appointments through the appointment_service pivot table.
$service->appointments; // All appointments that include this service
The pivot table columns are:
ColumnTypeDescription
appointment_idintegerForeign key → appointments.id
service_idintegerForeign key → services.id
Attaching a service to an appointment:
$appointment->services()->attach($service->id);

Implicit service types

The current booking form does not create Service records at runtime. Instead, the servicio string field on Appointment encodes the service type directly. The three implicit types and their durations are:
servicio valueLabelDuration
corteHaircut30 minutes
barbaBeard trim30 minutes
ambosHaircut + beard trim60 minutes
The Service model and appointment_service pivot table are available for future use. If you extend the app with a dynamic service catalogue (custom pricing, per-barber services, etc.), populate the services table and update the booking flow to use $appointment->services()->attach() rather than the servicio enum string.

$fillable fields

protected $fillable = ['name', 'duration_minutes'];

Build docs developers (and LLMs) love