model

Generate Eloquent model classes for CatchAdmin modules with CatchModel features.

928|137|Updated Jan 6, 2020
One-click install
npx skills add https://github.com/JaguarJack/catch-admin --skill model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model
Source: https://github.com/JaguarJack/catch-admin/tree/main/.claude/skills/03-model
Command: npx skills add https://github.com/JaguarJack/catch-admin --skill model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating consistent, CatchAdmin-ready Eloquent models for modules is time-consuming and error-prone. This Skill automates the creation of fully-featured models that integrate with CatchModel and Laravel.

Core Features & Use Cases

  • Auto-create an Eloquent model at modules/{Module}/Models/{Model}.php with a complete CatchModel-based template.
  • Include standard fields, search definitions, form relations, and relation methods as needed.
  • Use case: Quickly scaffold a new module's data layer when adding a new feature or module to CatchAdmin.

Quick Start

  1. Create the model file at modules/{Module}/Models/{Model}.php using the template provided in this Skill.
  2. Ensure the {Module} namespace matches your module and the file contains a class extending CatchModel with appropriate properties.
  3. Integrate the model into the module's repository and run your usual Laravel/CatchAdmin tests.

Frequently Asked Questions about model

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

FAQPage Schema
How do I generate an Eloquent model for a CatchAdmin module?

Generate an Eloquent model by creating a class that extends CatchModel at modules/{Module}/Models/{Model}.php. The model should include fillable fields, searchable definitions, and relation methods tailored to your module's data structure.

What is CatchModel and how does it extend Laravel's Eloquent?

CatchModel is a CatchAdmin base class that extends Laravel's Eloquent with built-in support for searchable field definitions, form relations, and tree structures. It provides a consistent foundation for module models within the CatchAdmin framework.

Can I use this Skill to add search and relation definitions to my model?

Yes. The Skill generates models with support for searchable field definitions, relation methods, and tree structures. You define these features in the model template and they integrate automatically with CatchAdmin's query and form systems.

Do I need to manually create the modules directory structure before using this Skill?

You should ensure the modules/{Module}/Models/ directory exists before generating the model file. The Skill creates the model class but does not create parent directories; verify your module namespace matches the file path.

What happens after I generate the model—do I need additional setup?

After generation, integrate the model into your module's repository layer and run your Laravel and CatchAdmin test suite. The model is immediately ready to handle database queries and form operations within your module.

Can I use fillable and searchable fields in a generated CatchAdmin model?

Yes. The generated template includes fillable fields for mass assignment and searchable definitions for query filtering. Both are configured within the model class and work seamlessly with CatchAdmin's data layer.