Your data is temporary and will be lost if you don't sign in — Log in or Register to keep your work permanently.

Template Library

Start faster with a curated pre-built schema. Clone any template as your own project.

E-Commerce

E-Commerce

A full e-commerce schema with users, products, categories, orders and order items.

users categories products orders order_items
5 tables 4 relations

Marketplace

E-Commerce

A multi-vendor marketplace schema with users, shops, products, orders and reviews.

users shops products orders reviews
5 tables 6 relations

Blog

Blog

A classic blog schema with users, posts, comments, categories and tags.

users categories posts comments tags +1 more
6 tables 6 relations

Newsletter

Blog

A newsletter schema with subscribers, campaigns and individual send tracking.

subscribers campaigns sends unsubscribes users
5 tables 3 relations

Auth & Roles

SaaS

A role-based access control schema with users, roles and permissions linked through pivot tables.

users roles permissions role_user permission_role
5 tables 4 relations

SaaS Starter

SaaS

A multi-tenant SaaS schema with users, teams, subscriptions and invoices.

users teams team_user subscriptions invoices
5 tables 4 relations

LaraSchema Data Model

Meta

The internal schema of LaraSchema itself — a meta diagram showing all 9 tables and 11 relationships that power this tool.

users laraschema_categories laraschema_projects laraschema_export_jobs laraschema_tables +4 more
9 tables 9 relations

Belongs To

Reference Relationships

An Order belongs to a Customer. Use belongsTo() on the model that holds the foreign key — e.g. $order->customer.

customers orders users
3 tables 1 relation

Has Many

Reference Relationships

An Author has many Articles. Use hasMany() on the parent when one record owns multiple children — e.g. $author->articles.

authors articles users
3 tables 1 relation

Has Many Through

Reference Relationships

A Country has many Posts through its Users. Use hasManyThrough() to reach a grandchild model without a direct FK — e.g. $country->posts.

countries users posts
3 tables 3 relations

Has One

Reference Relationships

A User has exactly one Profile. Use hasOne() on the parent model when a child record is uniquely owned — e.g. $user->profile.

users profiles
2 tables 1 relation

Has One Through

Reference Relationships

A Mechanic has one CarOwner through the Car they service. Use hasOneThrough() to reach a distant model via an intermediate — e.g. $mechanic->carOwner.

mechanics cars car_owners users
4 tables 3 relations