# Custom Admin Shell Goal: admin UI fleksibel ala LesKu/Mirakos, modern/mobile-first, tanpa terkunci framework admin tertentu. ## Routes - Login: `/app-admin/login` - Dashboard: `/app-admin` - Permission Matrix: `/app-admin/access/matrix` - `/admin` redirects to `/app-admin` ## Prinsip - Plain Laravel routes/controllers/blade. - Reuse Laravel Auth + existing `users` table. - Reuse existing `BracService` and `User::canDoAction()`. - `read` controls menu visibility. - Action enforcement happens in controller via `abort_unless(...)`. - CSS inline/simple for POC; can later move to `resources/css` or static `public/app-admin`. - No npm/build dependency required for POC. - SweetAlert2 via CDN for quick UX; can be vendored/local later if needed. ## Why Custom admin shell keeps the app flexible: backend/domain remains Laravel, UI can evolve from plain Blade to Bootstrap, Tailwind, Alpine, HTMX, Vue, or anything else without rewriting BRAC/business logic. ## Next steps 1. Expand controllers/views per module: tenants, users, devices, messages, webhooks, plans. 2. Add route-level middleware like `appadmin.brac:module,action` to avoid repeated controller checks. 3. Move styles/scripts to versioned assets. 4. Add reusable Blade components for cards, tables, form fields, buttons. ## Platform Settings `/app-admin/settings` is the platform owner settings screen. It is BRAC-gated by `settings.read` and `settings.edit`. Current settings POC covers: - Platform identity: name, support email, timezone, currency. - WA Gateway/GOWA: default node, base URL, timeout. - Webhook retry policy. - Queue connection and global message rate limit. - Maintenance mode flag. - Gateway node list/status/capabilities. Settings are stored in Laravel cache under `platform.settings` for the POC. Later this should move to a `platform_settings` table or typed config table with audit history. ### `platform_settings` table Platform settings now persist in DB table `platform_settings` instead of cache. Columns: - `group` — logical group: identity, wa_gateway, webhook, queue, billing, etc. - `key` — unique setting key. - `value` — JSONB value payload. - `type` — string/integer/boolean/uuid/json. - `description` — human-readable purpose. - `is_public` — whether it can be exposed to public UI/API. Seed defaults are in `PlatformOwnerSeeder`.