Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Janblack07/OxygenDispatch/llms.txt

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

OxygenDispatch includes a built-in user management module that lets privileged administrators create staff accounts, assign roles, control login access, and reset passwords — all without touching the database directly. Every user account is tied to one of three roles that determine which areas of the application that user can access.
All user management routes (/users and its sub-actions) are protected by the role:PROGRAMADOR,ADMINISTRADOR middleware. Users with the ENCARGADO role cannot access the user list, create new accounts, edit existing ones, or perform any password or status actions. Attempts to access these routes will be blocked at the middleware level.

User fields

The following fields are available when creating or editing a user account:
name
string
required
Full display name for the user. Maximum 150 characters.
email
string
required
Email address used to log in. Must be a valid email format, unique across all user accounts, and no longer than 150 characters.
role
string
required
Access role assigned to the user. Must be one of the values defined in the AppRole enum: PROGRAMADOR, ADMINISTRADOR, or ENCARGADO. See the Roles section for a full description of each.
password
string
Account password. Minimum 8 characters. This field is optional on creation — if omitted, the system auto-generates a secure 12-character random password (plus a trailing !) and includes it in the success flash message. The password field is not available on the edit/update form; use the dedicated reset password action instead.
is_active
boolean
Controls whether the user can log in. Defaults to true on account creation. Can be toggled at any time via the toggle active action.

Creating users

POST /users
Submit the create form to register a new user account. If you leave the password field blank, a random 12-character alphanumeric string with a trailing ! is generated automatically using Laravel’s Str::random(12):
$password = $data['password'] ?? Str::random(12) . '!';
On success, the application redirects to the user list and displays a flash message in the format:
Usuario creado. Password: <generated-password>
The auto-generated password is displayed only once in the success flash message immediately after account creation. Copy it and share it with the new user before navigating away — once the page is refreshed or you leave the screen, the plain-text password cannot be retrieved. If it is lost, use the Reset Password action to issue a new one.

Managing existing users

List users

GET /users
Displays a paginated list of all user accounts, ordered by most recently created first. The list is paginated at 15 users per page.

Edit a user

GET  /users/{user}   # Load the edit form
PUT  /users/{user}   # Submit changes
The edit form allows updating name, email, and role. Passwords are intentionally excluded from the update form — to change a password, use the Reset Password action on the user’s row.

Delete a user

DELETE /users/{user}
Permanently removes the user account from the database. This action cannot be undone.

Toggling active status

POST /users/{user}/toggle-active
Flips the user’s is_active flag between true and false. This is a non-destructive way to prevent a user from logging in without deleting their account — useful for staff on leave or when access needs to be temporarily suspended.
  • If is_active is currently true → it becomes false (user is locked out)
  • If is_active is currently false → it becomes true (access restored)
The action redirects back to the previous page with a Estado actualizado. success message.

Resetting passwords

POST /users/{user}/reset-password
Generates a brand-new random password for the specified user — a 12-character alphanumeric string with a trailing ! — hashes it, saves it to the user record, and returns the plain-text value in the success flash message:
Nueva contraseña: <new-password>
This is the only way to change an existing user’s password through the UI. The action redirects back to the previous page on success.
Like the creation password, the new password from a reset is shown only once in the flash message. Copy it immediately and relay it to the user. It cannot be recovered after you navigate away from the page.

Roles

OxygenDispatch uses three roles defined in the AppRole enum. Roles are stored as plain strings on the users table.
RoleAccess
PROGRAMADORFull access to all features, including user management, catalog setup, batch and tank operations, dispatches, and reports
ADMINISTRADORFull access to all features, including user management, catalog setup, batch and tank operations, dispatches, and reports
ENCARGADOAccess to all operational features (batches, tanks, dispatches, inventory movements, reports, technical receptions); cannot access user management routes

Build docs developers (and LLMs) love