The Laravel schema nobody chose
Fifteen real Laravel applications, every one of them a codebase you can go and read. 811 tables. One pinned MySQL 8.0 database, migrations only, no seed data. Every application installed from a clean clone and migrated before a single table was read. This is not a review of those fifteen projects. It is a census: a look at what a Laravel schema actually looks like once an application has shipped…
The article presents a census of Laravel schemas from 15 real applications, revealing interesting conventions and differences. Six tables across four projects have no primary key, which is the default Laravel scaffold, not a mistake by the projects. Laravel replaced this scaffold with a table using an actual primary key in Laravel 13, but some projects still maintain the old design.
When examining relationships, only 7 out of 482 tables across 12 databases have foreign key constraints. This indicates that half of the applications rely on application code for relationships, while the other half let the database handle them. The choice of database engine impacts the schema, with some projects creating foreign keys that only work with specific engines.
The article concludes that Laravel scaffolding propagates certain design choices, and the relationship between applications and their schemas varies significantly.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.