lc:orphaned-records

Detect and remediate orphaned database records in Laravel environments.

12|2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/edulazaro/laraclaude --skill lc-orphaned-records
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lc:orphaned-records
Source: https://github.com/edulazaro/laraclaude/tree/main/skills/orphaned-records
Command: npx skills add https://github.com/edulazaro/laraclaude --skill lc-orphaned-records

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the issue of data integrity in Laravel applications by identifying database records that reference non-existent parent records, which can cause application errors and inconsistent data states.

Core Features & Use Cases

  • Automated Detection: Scans database tables for foreign key violations using both migration analysis and direct database queries.
  • Soft-Delete Awareness: Distinguishes between truly orphaned records and those pointing to soft-deleted parents.
  • Safe Remediation: Provides options to delete orphans, nullify foreign keys, or generate cleanup migrations with mandatory user confirmation.

Quick Start

Run the lc:orphaned-records skill to analyze all database tables for orphaned records and report the findings.

Frequently Asked Questions about lc:orphaned-records

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

FAQPage Schema
How do I find orphaned database records in Laravel when foreign keys point to deleted parents?

Orphaned records in Laravel are found by parsing migration files and executing database queries via Docker to detect foreign keys referencing non-existent parents. The Skill validates data integrity by distinguishing between hard-deleted and soft-deleted parent records.

What is the best way to clean up orphaned data without breaking soft-deleted Laravel relationships?

The best way to clean up orphaned data safely is by using soft-delete awareness to distinguish truly orphaned records from those pointing to soft-deleted parents. The Skill proposes deleting orphans, nullifying foreign keys, or generating cleanup migrations with mandatory user confirmation.

Does this orphaned records cleanup tool run in Docker with existing Laravel migrations?

Yes, this orphaned records cleanup operates within Laravel environments by parsing existing migration files and executing database queries directly through Docker containers, requiring no additional external dependencies to validate data integrity.

How do I generate a cleanup migration for data integrity violations in a Laravel database?

To generate a cleanup migration for data integrity violations, the Skill analyzes foreign key constraints and proposes remediation actions. With mandatory user confirmation, it can automatically generate cleanup migrations to delete orphans or nullify foreign keys.

What precautions should I take before remediating foreign key violations in Laravel?

Before remediating foreign key violations, ensure you distinguish between hard-deleted and soft-deleted parent records to avoid breaking soft-deleted Laravel relationships. The Skill enforces mandatory user confirmation before executing any deletion, foreign key nullification, or cleanup migration actions.