nawasara / registry
Master data for OPD (organizational units), PIC (person-in-charge), and asset ownership across Nawasara packages.
v0.1.0
2026-05-07 21:04 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0|^12.0
- livewire/livewire: ^3.0
- nawasara/ui: *
- spatie/laravel-activitylog: ^4.9
- spatie/laravel-permission: ^6.0
README
Master data for the Nawasara superapp framework: organizational units (OPD), persons in charge (PIC), and a generic asset ownership index that other packages link into.
Features
- OPD — code, name, address, phone, email, and a list of related PIC contacts
- PIC (Person-in-Charge) — name, position, contact details, scoped to one OPD
- Asset — generic ownership record keyed by
(package_ref, external_id). Other packages (Cloudflare DNS, WHM Account, Email account) write here with their canonical IDs so the dashboard can render an "OPD / PIC" column on every resource list and a single OPD detail page can show every asset they own - Activity log — every write is captured via
spatie/laravel-activitylog - Admin pages — Livewire CRUD for OPD, PIC, and Asset with search, filter, and detail modals
Installation
composer require nawasara/registry
php artisan migrate
php artisan db:seed --class="Nawasara\Registry\Database\Seeders\PermissionSeeder" --force
Auto-discovered.
Asset linking pattern
Other packages create an asset row whenever they create a managed resource:
use Nawasara\Registry\Models\Asset; Asset::updateOrCreate( ['package_ref' => 'whm', 'external_id' => $username], [ 'type' => 'hosting_account', 'identifier' => $domain, 'opd_id' => $form['opd_id'] ?: null, 'pic_id' => $form['pic_id'] ?: null, 'status' => 'active', 'registered_at' => now(), ], );
Resource list pages then look up the asset map in one query:
$assetMap = Asset::where('package_ref', 'whm') ->whereIn('external_id', $usernames) ->with(['opd:id,name,code', 'pic:id,name']) ->get() ->keyBy('external_id');
Pages
| Route | Permission |
|---|---|
/admin/registry/opd |
registry.opd.view |
/admin/registry/pic |
registry.pic.view |
/admin/registry/asset |
registry.asset.view |
Author
Pringgo J. Saputro <odyinggo@gmail.com>
License
MIT