> For the complete documentation index, see [llms.txt](https://core-foundation-doc.rupeshstha.com.np/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://core-foundation-doc.rupeshstha.com.np/apm-and-devtools/scaffolding.md).

# Scaffolding (core:make)

Core Foundation provides an interactive Artisan command to scaffold new modules and components. It ensures that all new classes follow the foundation's naming conventions and are placed in the correct directories.

## Usage

Run the command and follow the interactive prompts:

```bash
php artisan core:make {Name}
```

## Presets

### 1. CRUD Preset

Generates a complete resource module including:

* **Database**: Model, Factory, Migration.
* **Repository**: Concrete Repository & Interface.
* **Business Logic**: Service & Data Object (DTO).
* **HTTP**: Controller, Store Request, Update Request.
* **Presentation**: Resource & Collection.
* **Security**: Policy & Observer.
* **Wiring**: Service Provider.
* **Testing**: Feature Test.

### 2. Custom Feature Preset

A leaner option for logic-heavy modules:

* Service
* Data Object
* Feature Test

## Module Structure

The command defaults to a **Module Folder Structure**, which is recommended for modular monoliths:

```
app/Modules/{Name}/
├── Models/
├── Repositories/
├── Services/
├── Http/
│   ├── Controllers/
│   └── Requests/
├── Resources/
├── Policies/
└── Providers/
```

## Next Steps Prompt

After generation, the command provides a list of "Next Steps" (e.g., registering the ServiceProvider or adding routes) to help you get the new module live immediately.
