Creating Apps

Apps control which functionality is available to tenants. They appear in the app switcher.

Creating an App

php artisan noerd:create-app

The command asks for:

  1. App Title - Display name (e.g., "Customer Management")
  2. App Name - Unique identifier, uppercase (e.g., "CRM")
  3. Icon - Heroicon name (searchable)
  4. Route - Main route name (e.g., "crm.index")

Assigning Apps to Tenants

php artisan noerd:assign-apps-to-tenant

Select a tenant, then toggle apps on/off with Space.

Quick Workflow

# 1. Create the module
php artisan noerd:module crm

# 2. Register module
composer update noerd/crm
php artisan migrate

# 3. Create the app
php artisan noerd:create-app

# 4. Assign to tenant
php artisan noerd:assign-apps-to-tenant

Background: Apps vs. Modules

Apps and modules are not the same thing.

Aspect Module App
Purpose Code organization User access control
Location app-modules/ Database (tenant_apps table)
Contains PHP code, views, routes Configuration only

Examples

  • One module, multiple apps: The noerd module provides both "Setup" and core functionality.
  • Multiple modules, one app: A "Shop" app might combine product, order, and voucher modules.
  • One module, one app: A media module maps directly to a "Media" app.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Tenant A β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ CMS App β”‚ β”‚Shop App β”‚ β”‚Setup Appβ”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚cms module β”‚ β”‚product β”‚ β”‚noerd β”‚ β”‚ β”‚ β”‚order β”‚ β”‚module β”‚ β”‚ β”‚ β”‚voucher β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Detailed Command Reference

noerd:create-app

Interactive mode:

$ php artisan noerd:create-app

 App Title (display name):
 > Customer Management

 App Name (unique identifier):
 > CRM

 Search for a Heroicon:
 > users

 App Route:
 > crm.index

βœ… Tenant app created successfully!
e>

Non-interactive mode:

php artisan noerd:create-app \
  --title="Customer Management" \
  --name="CRM" \
  --icon="heroicon:outline:users" \
  --route="crm.index"

noerd:assign-apps-to-tenant

$ php artisan noerd:assign-apps-to-tenant

 Select a tenant:
 > Company Inc. (ID: 1, Apps: 2)

 Select apps to assign:
 β€Ί β—‰ CMS (CMS)
   β—― Customer Management (CRM)
   β—‰ Setup (SETUP)

βœ… App assignments updated successfully!
y!

Non-interactive:

php artisan noerd:assign-apps-to-tenant --tenant-id=1

App Navigation

Each app needs a navigation.yml:

app-configs/{app-name}/navigation.yml

Example:

- title: crm_nav_customers
  name: customers
  route: crm.index
  block_menus:
    - title: crm_nav_overview
      navigations:
        - { title: crm_nav_customers, route: crm.customers, heroicon: users }