Template Library
Start faster with a curated pre-built schema. Clone any template as your own project.
E-Commerce
A full e-commerce schema with users, products, categories, orders and order items.
Marketplace
A multi-vendor marketplace schema with users, shops, products, orders and reviews.
Blog
A classic blog schema with users, posts, comments, categories and tags.
Newsletter
A newsletter schema with subscribers, campaigns and individual send tracking.
Auth & Roles
A role-based access control schema with users, roles and permissions linked through pivot tables.
SaaS Starter
A multi-tenant SaaS schema with users, teams, subscriptions and invoices.
LaraSchema Data Model
The internal schema of LaraSchema itself — a meta diagram showing all 9 tables and 11 relationships that power this tool.
Belongs To
An Order belongs to a Customer. Use belongsTo() on the model that holds the foreign key — e.g. $order->customer.
Has Many
An Author has many Articles. Use hasMany() on the parent when one record owns multiple children — e.g. $author->articles.
Has Many Through
A Country has many Posts through its Users. Use hasManyThrough() to reach a grandchild model without a direct FK — e.g. $country->posts.
Has One
A User has exactly one Profile. Use hasOne() on the parent model when a child record is uniquely owned — e.g. $user->profile.
Has One Through
A Mechanic has one CarOwner through the Car they service. Use hasOneThrough() to reach a distant model via an intermediate — e.g. $mechanic->carOwner.