← All schemas
Schema Library

Laravel Database Schema Diagram

A fresh Laravel 13 application ships with eight framework tables created by the default migrations: users, password_reset_tokens, sessions, cache, cache_locks, jobs, job_batches, and failed_jobs. This diagram shows the full default schema - the users table with password and remember_token columns, the sessions table with its user_id index, and the queue tables that track jobs and batches.

Written by Varun Krishnan · Founder, dbdiagramr

Published · Updated

Source: Laravel v13.11.0 default migrations (laravel/laravel) · License: MIT

Tables
8
Core table
users
Framework
Laravel 13.11.0

Default migrations from laravel/laravel v13.11.0, released 2026-10-06.

Package tables such as Sanctum personal_access_tokens and optional Artisan-generated tables are not part of the framework defaults. default migrations.

Laravel database schema diagram showing every table, column, and foreign key

Scroll horizontally to see the full diagram. Click it to open at full size.

Open in DBdiagramr to edit →

Embed this diagram

Paste this HTML into a README, docs page, or blog post. The image links back to the full schema page.

<a href="https://www.dbdiagramr.space/schema/laravel">
  <img src="https://www.dbdiagramr.space/schemas/laravel-er-diagram.svg" alt="Laravel Database Schema Diagram" width="2290" height="390" />
</a>
<p><a href="https://www.dbdiagramr.space/schema/laravel">Laravel Database Schema Diagram</a> by dbdiagramr</p>

Tables in the Laravel schema

ColumnTypeNullableKey
users
idbigintNoPK
namevarcharNo-
emailvarcharNo-
email_verified_attimestampYes-
passwordvarcharNo-
remember_tokenvarchar(100)Yes-
created_attimestampYes-
updated_attimestampYes-
password_reset_tokens
emailvarcharNoPK
tokenvarcharNo-
created_attimestampYes-
sessions
idvarcharNoPK
user_idbigintYes-
ip_addressvarchar(45)Yes-
user_agenttextYes-
payloadtextNo-
last_activityintegerNo-
jobs
idbigintNoPK
queuevarcharNo-
payloadtextNo-
attemptssmallintNo-
reserved_atintegerYes-
available_atintegerNo-
created_atintegerNo-
job_batches
idvarcharNoPK
namevarcharNo-
total_jobsintegerNo-
pending_jobsintegerNo-
failed_jobsintegerNo-
failed_job_idstextNo-
optionstextYes-
cancelled_atintegerYes-
created_atintegerNo-
finished_atintegerYes-
failed_jobs
idbigintNoPK
uuidvarcharNo-
connectionvarcharNo-
queuevarcharNo-
payloadtextNo-
exceptiontextNo-
failed_attimestampNo-
cache
keyvarcharNoPK
valuetextNo-
expirationbigintNo-
cache_locks
keyvarcharNoPK
ownervarcharNo-
expirationbigintNo-

Common queries

These PostgreSQL queries run against the schema shown on this page.

Queue backlog

Count waiting jobs by queue name.

select queue, count(*) as jobs
from jobs
group by queue
order by jobs desc, queue;

Failed job history

List failed jobs newest first.

select id, connection, queue, failed_at
from failed_jobs
order by failed_at desc;

Sessions per user

Count database sessions for each user.

select u.email, count(s.id) as sessions
from users u
left join sessions s on s.user_id = u.id
group by u.id, u.email
order by sessions desc, u.email;

Cache entries

Inspect stored cache keys and expiry timestamps.

select key, expiration
from cache
order by expiration, key;

What each default Laravel table does

The default migrations are split by purpose. The first file creates authentication and session storage; the second creates the cache; the third creates queue tracking.

TablePurpose
usersApplication accounts: name, unique email, password hash, verification timestamp, and remember token.
password_reset_tokensOne row per email address requesting a reset, keyed by email, with the hashed token and creation time.
sessionsServer-side session payloads keyed by a string session id, with an indexed user_id, IP address, user agent, and last activity time.
cache / cache_locksDatabase cache values and locks, keyed by cache key, with expiration timestamps.
jobsQueued jobs waiting to run, with queue name, payload, attempts, reservation time, and availability time.
job_batchesBatch metadata: total, pending, and failed counts, failed job ids, options, cancellation, creation, and finish times.
failed_jobsJobs that exhausted their attempts, with connection, queue, payload, exception, and failure time.

The sessions.user_id column is indexed but is not declared as a foreign key in the default migration. That keeps the session table usable when users are deleted or when the session driver runs without a users table.

Default tables vs package tables

Only the eight tables above come from a fresh laravel/laravel install. Other common tables arrive with packages or optional Artisan commands:

  • personal_access_tokens comes from Laravel Sanctum, not the framework skeleton.
  • password_resets is the old pre-Laravel 8 name. Current applications use password_reset_tokens.
  • Older tutorials call the queue batch table batches; the current default migration creates job_batches.
  • Redis can replace the database drivers for sessions, cache, and queues, in which case those tables may exist but go unused.

The source for this page is the Laravel 13 default migrations.

Frequently asked questions

Related schema diagrams

Visualize your own database

Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.

Try it free →