Prueba Soporte uses a relational database (MySQL or SQLite) managed entirely through Laravel Eloquent migrations. There are four tables created by the initial migrations:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/estebansalas94/Prueba-Soporte/llms.txt
Use this file to discover all available pages before exploring further.
users, password_reset_tokens, sessions, and tasks.
Entity relationship
CASCADE constraint on the foreign key.
Table schemas
users table
Created by migration 0001_01_01_000000_create_users_table.php.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | bigint unsigned | PK, auto-increment | Primary key |
name | varchar(255) | NOT NULL | Display name |
email | varchar(255) | NOT NULL, UNIQUE | Login email |
email_verified_at | timestamp | nullable | Set when email is verified |
password | varchar(255) | NOT NULL | Bcrypt hash (cast as hashed in model) |
remember_token | varchar(100) | nullable | ”Remember me” session token |
created_at | timestamp | nullable | Managed by Eloquent |
updated_at | timestamp | nullable | Managed by Eloquent |
tasks table
Created by migration 2024_09_09_123452_create_task.php.
| Column | Type | Constraints | Description |
|---|---|---|---|
id | bigint unsigned | PK, auto-increment | Primary key |
user_id | bigint unsigned | NOT NULL, FK → users.id | Owning user |
title | varchar(255) | NOT NULL | Task title |
description | longtext | NOT NULL | Task description |
completed | tinyint(1) | NOT NULL, DEFAULT 0 | 0 = pending, 1 = completed |
created_at | timestamp | nullable | Managed by Eloquent |
updated_at | timestamp | nullable | Managed by Eloquent |
The
TaskController@index method filters tasks with Task::where('completed', 0)->get(), so only pending tasks are ever returned to the frontend. Completed tasks remain in the database but are not exposed through the API.Supporting tables
The users migration also creates two auxiliary tables:password_reset_tokens — Stores one-time tokens for the password reset flow.
sessions — Stores database-backed PHP sessions (used when SESSION_DRIVER=database).
Eloquent models
Task model
$table = 'tasks'— explicit table name (matches the default convention but stated explicitly).$guarded = []— no columns are guarded from mass assignment. All columns can be filled vianew Task([...])orTask::create([...]).user()— defines abelongsTorelationship toUservia theuser_idforeign key.
User model
- Extends
Authenticatable— provides authentication logic, session management, and password hashing support. $fillable— onlyname,email, andpasswordcan be mass-assigned.$hidden—passwordandremember_tokenare excluded from JSON serialization (e.g. in API responses).casts()—email_verified_atis returned as a Carbon datetime object;passwordis automatically hashed when set.tasks()— defines ahasManyrelationship toTask. Calling$user->tasksreturns all tasks owned by that user.
Relationship summary
| Relationship | Direction | Method | Foreign key |
|---|---|---|---|
Task belongs to User | Many → One | Task::user() | tasks.user_id |
User has many Task | One → Many | User::tasks() | tasks.user_id |
onDelete('cascade') constraint on tasks.user_id ensures that deleting a user from the users table automatically removes all associated rows from the tasks table at the database level, independently of the Eloquent relationship.