Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ericcobasdev/careertrack-api/llms.txt

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

CareerTrack’s persistence layer is built on two primary tables: users and job_applications. The users table stores authenticated account information managed by Laravel’s built-in auth scaffolding, while job_applications stores every application record and references back to the owning user via a foreign key. A third table — personal_access_tokens — is managed entirely by Laravel Sanctum and stores the API tokens used for authentication.

Users table

The users table is created by the default Laravel migration and extended with the HasApiTokens trait from Sanctum to support token-based authentication.
ColumnTypeNullableDescription
idbigint (unsigned)NoAuto-incrementing primary key.
namevarchar(255)NoThe user’s display name.
emailvarchar(255)NoUnique email address used for login.
email_verified_attimestampYesSet when the user verifies their email; null if unverified.
passwordvarchar(255)NoBcrypt-hashed password. Never returned by the API.
remember_tokenvarchar(100)YesLaravel’s standard remember-me token. Never returned by the API.
created_attimestampYesTimestamp of account creation.
updated_attimestampYesTimestamp of last account update.
The User model marks password and remember_token as hidden, so they are never included in serialised output or API responses.

Job applications table

The job_applications table is created by the 2026_04_05_124911_create_job_applications_table migration. Every column maps directly to a field exposed by the API.
ColumnTypeNullableDefaultDescription
idbigint (unsigned)Noauto-incrementPrimary key.
user_idbigint (unsigned)NoForeign key → users.id. Cascades on delete.
company_namevarchar(255)NoName of the company.
position_titlevarchar(255)NoTitle of the role applied for.
statusvarchar(255)No'applied'Current lifecycle stage. Constrained to enum values at the application layer.
sourcevarchar(255)YesnullWhere the listing was found (e.g. LinkedIn, Indeed).
source_urlvarchar(255)YesnullDirect URL to the job posting.
salary_minintYesnullLower bound of the expected salary range.
salary_maxintYesnullUpper bound of the expected salary range.
locationvarchar(255)YesnullRole location (e.g. Remote, New York, NY).
notestextYesnullFree-form notes about the application.
applied_atdateYesnullThe date the application was submitted.
next_step_attimestampYesnullDatetime of the next scheduled step (interview, deadline, etc.).
created_attimestampYesnullAuto-managed record creation timestamp.
updated_attimestampYesnullAuto-managed last-modified timestamp.

Relationships

The two tables share a straightforward one-to-many relationship:
  • A User has many JobApplications — expressed in the User model as hasMany(JobApplication::class).
  • A JobApplication belongs to one User — expressed in the JobApplication model as belongsTo(User::class).
  • The foreign key job_applications.user_id references users.id and is configured with cascadeOnDelete: when a user account is deleted, all of their job applications are deleted automatically.
users                        job_applications
─────────────────────        ─────────────────────────────
id            ◄──────────── user_id  (FK, cascade delete)
name                         id
email                        company_name
email_verified_at            position_title
password                     status
remember_token               source
created_at                   source_url
updated_at                   salary_min
                             salary_max
                             location
                             notes
                             applied_at
                             next_step_at
                             created_at
                             updated_at

Model casts

The JobApplication model defines three explicit casts that transform raw database values into richer PHP types on read, and back to their storage format on write:
PropertyCastBehaviour
statusApplicationStatus::classDeserialises the stored string into an ApplicationStatus enum instance. The API serialises it back to its string value in responses.
applied_at'date'Parsed as a Carbon date object (no time component). The API formats it as YYYY-MM-DD in responses.
next_step_at'datetime'Parsed as a full Carbon datetime. The API formats it as an ISO 8601 string (e.g. 2026-04-10T14:00:00.000000Z) in responses.
protected $casts = [
    'status'       => ApplicationStatus::class,
    'applied_at'   => 'date',
    'next_step_at' => 'datetime',
];

Personal access tokens

Laravel Sanctum creates and manages a personal_access_tokens table to store the API bearer tokens issued during login. CareerTrack does not expose this table through the API — it is an internal implementation detail. The User model includes the HasApiTokens trait to wire up token creation and revocation. Every request to a protected endpoint must present a valid token in the Authorization: Bearer <token> header; Sanctum resolves the authenticated user from that token before any controller logic runs.
For local development, CareerTrack works out of the box with SQLite. SQLite requires no separate database server process — just set DB_CONNECTION=sqlite in your .env file and run php artisan migrate. The database is stored as a single file (database/database.sqlite) that you can delete and recreate at any time.

Build docs developers (and LLMs) love