Design and manage your database schemas.
A headless CMS schema with pages, sections, media, menus, menu items and page revisions.
A social platform schema covering users, posts, comments, likes, follows and notifications.
A role-based access control schema with users, roles and permissions linked through pivot tables.
A newsletter schema with subscribers, campaigns and individual send tracking.
A multi-vendor marketplace schema with users, shops, products, orders and reviews.
A Category that can nest under another Category using a parent_id foreign key. Use hasMany() and belongsTo() on the same model — e.g. $category->children, $category->parent.
A Post morphs one Image. Use morphOne() when a single child can belong to multiple parent types — e.g. $post->image. The imageable_type column stores the parent class name.
A multi-tenant SaaS schema with users, teams, subscriptions and invoices.
Posts and Videos can each be tagged via a polymorphic pivot (taggables). Use morphToMany() on the parent and morphedByMany() on Tag — e.g. $post->tags, $video->tags.
Posts and Videos can each have many Comments via a polymorphic relation. Use morphMany() on each parent and morphTo() on Comment — e.g. $post->comments, $video->comments.
A Country has many Posts through its Users. Use hasManyThrough() to reach a grandchild model without a direct FK — e.g. $country->posts.
A Mechanic has one CarOwner through the Car they service. Use hasOneThrough() to reach a distant model via an intermediate — e.g. $mechanic->carOwner.
Showing 1 to 12 of 19 results