# Hello World Addon

Reference implementation of the PROCP addon module system.

## Structure

- `HelloWorld.php` — main addon class (extends `AbstractAddon`)
- `module.json` — manifest (name, version, clientarea config, requires)
- `migrations/` — schema (auto-run on activate, rolled back on uninstall)
- `seeders/DefaultDataSeeder.php` — default data (auto-run on first install)
- `Models/HelloLog.php` — Eloquent model on `addon_hello_world_logs`
- `Hooks/HelloWorldClientAddHook.php` — listens to `ClientAdd` action hook
- `views/{admin,clientarea}.blade.php` — entry views (use `addon-hello-world::` namespace)
- `lang/{tr,en}/hello-world.php` — translations (flat-key only)

## Capabilities Demonstrated

- `configFields()` — auto-renders editable settings on the configure page
- `adminOutput()` / `clientareaOutput()` — entry points dispatched by
  `AddonDispatchController` / `ClientareaAddonDispatchController`
- Lifecycle migrations (`up()` on activate, `down()` on uninstall)
- First-install seeder hook
- Hook auto-discovery (Hooks/ folder) with active-only gating
- Translation namespace (`addon-hello-world::hello-world.greeting`)
- View namespace (`addon-hello-world::admin`, `addon-hello-world::clientarea`)
- Spatie permissions auto-created (`access addon hello-world`, `manage addon hello-world`)
- ClientAccountSwitcher integration via `clientarea_permission: __BASIC__`

## Activate

```bash
sail artisan addon:activate hello-world
```

Then visit `/admin/addon-modules` and click "Configure", or hit
`/admin/addons/hello-world` directly.

## Doctor

```bash
sail artisan addon:doctor hello-world
```

Should report all checks `ok` (no errors, no warnings).

## Uninstall

```bash
sail artisan addon:deactivate hello-world
sail artisan addon:uninstall hello-world
```

`uninstall` rolls back migrations and removes the `addon_modules` row.
