Creating Modules
Using modules is completely optional. The application works perfectly fine without any modules.
The module approach is very inspired by https://github.com/InterNACHI/modular
Use the noerd:module Artisan command to create a new module with complete directory structure.
Quick Start
php artisan noerd:module
The command will ask for:
- Module name (e.g.,
inventory) - Main model name (e.g.,
item)
Next Steps
After the command completes:
# 1. Register the module
composer update noerd/{module-name}
# 2. Run migrations
php artisan migrate
# 3. Create TenantApp
php artisan noerd:create-app
# Name: {ModuleName}
# Route: {module-name}.index
Customization
After creation, customize the module:
- Add fields: Edit
details/{model}-detail.yml - Add columns: Edit
lists/{models}-list.yml - Add migrations: Create in
database/migrations/ - Add relationships: Edit model in
src/Models/ - Add routes: Edit
routes/{module-name}-routes.php
Module Structure Reference
| Directory | Purpose |
|---|---|
app-contents/ |
YAML configurations |
database/migrations/ |
Database migrations |
resources/views/components/ |
Volt components (⚡ prefix) |
resources/lang/ |
Translations (JSON) |
routes/ |
Route definitions |
src/Models/ |
Eloquent models |
src/Providers/ |
ServiceProvider |
tests/ |
Pest tests |
Next Steps
- Lists - Customize list views
- Detail Views - Customize detail forms
- YAML Configuration - Full YAML reference