model

Generate Laravel Eloquent model skeleton files in app/Models.

Updated Jul 18, 2022
One-click install
npx skills add https://github.com/milosptr/pos-system --skill model-milosptr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model
Source: https://github.com/milosptr/pos-system/tree/main/.claude/skills/model
Command: npx skills add https://github.com/milosptr/pos-system --skill model-milosptr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates boilerplate creation of Laravel Eloquent models that adhere to this project's conventions, reducing repetitive setup and potential inconsistencies.

Core Features & Use Cases

  • Generates a model file in app/Models with standard structure, HasFactory trait, and placeholder constants.
  • Defines typical patterns for status/type fields, relationships, casts, and fillable attributes to accelerate development for new entities.
  • Use Case: when introducing a new database entity with relationships and behaviors, this tool provides a ready-to-migrate model skeleton and consistent scaffolding.

Quick Start

Run the model generator with the desired ModelName to create a scaffolded Eloquent model in app/Models following project conventions.

Frequently Asked Questions about model

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

FAQPage Schema
How do I scaffold a Laravel Eloquent model with consistent patterns?

To scaffold a Laravel Eloquent model, provide a target ModelName to generate a skeleton file in app/Models. The model includes the HasFactory trait, placeholder constants, relationship definitions, casts, and fillable attributes following established project conventions.

What is the best way to automate boilerplate creation for Laravel models?

Automating boilerplate creation for Laravel models involves running a generator with a ModelName argument. This validates naming and produces a ready-to-migrate Eloquent model skeleton, reducing repetitive setup and potential inconsistencies across app/Models.

Does this Laravel model generator include relationships and traits automatically?

Yes, the Laravel model generator includes standard structures like the HasFactory trait, typical relationship patterns, status or type field constants, casts, and fillable attributes to accelerate development for new database entities.

Can I use this scaffolding tool for new database entities with custom behaviors?

Yes, you can use this scaffolding tool for new database entities with custom behaviors. It generates a ready-to-migrate model skeleton with standard structure and placeholder constants, allowing you to easily extend the code for specific entity behaviors.

Why does my generated Laravel model include placeholder constants?

Your generated Laravel model includes placeholder constants to define typical patterns for status or type fields. This ensures consistent structure and code quality across app/Models, accelerating development when introducing new entities with specific behaviors.

What do I need to provide to generate a Laravel model skeleton?

You need to provide a target ModelName argument to generate a Laravel model skeleton. The generator validates the naming convention and automatically creates the Eloquent model file in the app/Models directory following established project patterns.