Admin panel
Add the optional Pondoknusa admin UI for CRUD, policies, and audit logging.
Install
bash
pondoknusa admin:installScaffolds:
config/admin.ts— prefix, middleware, audit log- Admin routes and policies
@pondoknusa/adminprovider registration
Config
typescript
// config/admin.ts
export default {
enabled: env('ADMIN_ENABLED', true),
prefix: env('ADMIN_PREFIX', '/admin'),
middleware: ['web', 'auth'],
accessAbility: 'access-admin',
perPage: 25,
auditLog: { enabled: true, table: 'admin_audit_log' },
};Gate access with a policy ability (access-admin) on your user model.
Usage
- Register models you want to manage in the admin provider stub
- Visit
/admin(or yourprefix) while authenticated with the ability - Audit entries land in
admin_audit_logwhen enabled
Testing
Use @pondoknusa/testing HTTP sugar:
typescript
const response = await t.http
.actingAs(adminUser)
.get('http://localhost/admin');
await response.assertOk();See @pondoknusa/admin in the package reference.