database-design

Design and implement Laravel database schemas with migrations and indexing.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/bramato/laravel-react-plugins --skill database-design-bramato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/bramato/laravel-react-plugins/tree/main/laravel-react/skills/database-design
Command: npx skills add https://github.com/bramato/laravel-react-plugins --skill database-design-bramato

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design, implement, and optimize database schemas for Laravel applications, ensuring data integrity, performance, and maintainability.

Core Features & Use Cases

  • Migration Best Practices: Learn how to create clear, maintainable, and safe database migrations.
  • Column Types & Modifiers: Understand the full range of available column types and their modifiers for precise data representation.
  • Indexing Strategies: Implement effective indexing to speed up queries and improve application performance.
  • Eloquent Relationships: Define and utilize all types of Eloquent relationships (one-to-one, one-to-many, many-to-many, polymorphic) correctly.
  • Soft Deletes & Transactions: Implement safe data deletion and ensure data consistency with database transactions.
  • Query Optimization: Learn techniques to prevent N+1 problems, use subqueries, and optimize common query patterns.
  • Use Case: When creating a new orders table, this Skill will guide you on defining columns like user_id (foreign key), status (enum), total (decimal), and setting up appropriate indexes and timestamps.

Quick Start

Use the database-design skill to create a migration for a new products table with name, price, and stock columns.

Frequently Asked Questions about database-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a database schema with migrations in Laravel?

Designing a database schema with migrations in Laravel involves defining tables using specific column types, modifiers, and foreign keys to ensure data integrity. This process establishes a maintainable and efficient foundation for web applications.

What is the best way to set up Eloquent relationships and indexing in Laravel?

Setting up Eloquent relationships and indexing in Laravel is best achieved by defining relationship methods like one-to-many or polymorphic, combined with strategic database indexes. This approach optimizes query performance and prevents common N+1 issues.

When should I use soft deletes and database transactions in Laravel?

Use soft deletes and database transactions in Laravel when you need safe data deletion and strict consistency. Soft deletes preserve records by marking them as deleted, while transactions bundle multiple operations to prevent partial updates.

How does query optimization prevent the N+1 problem in Eloquent?

Query optimization prevents the N+1 problem in Eloquent by utilizing techniques like eager loading, subqueries, and efficient indexing strategies. These methods reduce redundant database calls and significantly improve application performance.

Can I use Laravel migrations to manage column types and foreign keys for an orders table?

Yes, Laravel migrations support precise data representation through various column types and modifiers. You can define columns like user_id with foreign keys, status with enums, and total with decimals to create robust tables like an orders schema.