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 User model extends Laravel’s built-in Authenticatable base and represents every staff account in AR Barbería. A role field distinguishes barbers from other account types, and an is_active flag controls whether a barber appears in the customer-facing homepage listing. Authentication is handled by Laravel Breeze using email and password.

Fields

id
integer
required
Auto-incrementing primary key.
name
string
required
The barber’s display name. Shown on the public homepage and in the booking form.
email
string
required
Unique email address used for authentication. Validated for uniqueness at registration.
email_verified_at
datetime
Timestamp set when the user verifies their email address. Null if the email has not been verified.
password
string
required
Bcrypt-hashed password. This field is listed in $hidden and will never appear in serialised output (JSON responses, toArray(), etc.).
role
string
required
Identifies the account type. Use 'barber' for staff who take bookings. Only users with role = 'barber' are queried when building the barber selection list on the booking page.
is_active
boolean
required
Controls public visibility. Only barbers where is_active = true are shown on the homepage. Set to false to hide a barber without deleting their account or historical appointments.
remember_token
string
Laravel-managed token for the “remember me” session feature. Listed in $hidden and excluded from all serialised output.
created_at
datetime
Timestamp set automatically when the account is created.
updated_at
datetime
Timestamp updated automatically on every save.

Role convention

The role field is a plain string column. The application currently uses 'barber' as the value for staff accounts. Querying active barbers for the homepage looks like:
User::where('role', 'barber')->where('is_active', true)->get();
There is no enum constraint on the role column at the database level. Any string value is accepted. If you add new account types (for example, 'admin'), document the expected values so they stay consistent across the codebase.

Hidden fields

The following fields are excluded from JSON serialisation and toArray() calls:
protected $hidden = ['password', 'remember_token'];
This means these fields will never appear in API responses or when a User model is cast to an array — they must be accessed explicitly on the model instance when needed (for example, during authentication checks).

Relations

appointments() — hasMany Appointment

Returns all appointments booked with this barber.
$barber->appointments;                      // All bookings (including soft-deleted)
$barber->appointments()->where('status', 'pending')->get(); // Pending only

workdays() — hasMany Workday

Returns the barber’s per-day schedule configuration records.
$barber->workdays; // Collection of Workday models for this barber

Authentication

AR Barbería uses Laravel Breeze for authentication. Staff log in at /login with their email and password. Session management, CSRF protection, and the remember-me cookie are all handled by the Breeze scaffolding.
To create a new barber account during setup, use a database seeder or Tinker:
User::create([
    'name'      => 'Carlos López',
    'email'     => 'carlos@example.com',
    'password'  => bcrypt('secret'),
    'role'      => 'barber',
    'is_active' => true,
]);

$fillable fields

protected $fillable = ['name', 'email', 'password', 'role', 'is_active'];

Build docs developers (and LLMs) love