super-admin-org/super-admin
Super Admin is a Laravel package for adding a secure super-admin layer to your application. It provides organization-aware access control, admin routing, and tools for managing users, roles, and permissions so you can build admin panels faster.
Install and pin the version. Given the sparse release history (v1.1.5 is described only as “First relase of super-admin”), pin explicitly so a surprise patch can’t change privileged-access behavior under you:
composer require super-admin-org/super-admin:^1.1.5
Laravel’s package discovery should register the service provider automatically; if not, confirm it in bootstrap/providers.php (Laravel 11+) or config/app.php.
Publish everything, then read it. Run the publish command with each tag the provider exposes (typically config, migrations, assets, views — check php artisan vendor:publish --provider="SuperAdmin\\...\\ServiceProvider" without a tag to list them). Before running any migration, open the generated migration files and confirm whether they add new tables (organizations, memberships) or alter users.
Where to look first, in order:
config/super-admin.php (or similarly named) — route prefix, middleware stack, guard, table names, model bindings.routes/ file — what endpoints exist and what middleware protects them.First use case: give one trusted operator a bypass of normal authorization, plus organization-scoped user management. Create the admin user, attach the super-admin role/flag the package expects (check the config/seeder/docs for how), assign them to an organization, then hit the admin route prefix (default is usually /super-admin or similar — verify in config) while authenticated as that user.
Gate-check the bypass once, centrally. Rather than sprinkling checks, define a single gate (e.g. Gate::before(fn ($user) => $user->isSuperAdmin() ? true : null) or use the package’s middleware) so the bypass is auditable in one place and easy to remove later.
Protect the admin surface with middleware, not just route prefixes. Apply the package middleware to the whole admin route group and verify it’s in the web + auth stack:
Route::middleware(['web', 'auth', 'super-admin'])->prefix('super-admin')->group(...);
Extend with your own admin modules. The package advertises “extensible services and routes,” so register domain-specific admin routes alongside the package’s rather than editing published files — keeps upstream upgrades trivial.
Organization scoping as a query layer. For any custom admin listing, resolve the current organization (or operator-selected org) and scope queries through the membership pivot, e.g. $user->organizations()->where('organizations.id', $orgId). Don’t rely on middleware alone to scope data — enforce it in queries/policies too.
Override Blade scaffolding, don’t fork it. Publish views to resources/views/vendor/super-admin/ and restyle there. For behavior changes, extend controllers/services via container bindings or subclass the published route targets.
Seed a super admin in local/dev only. Gate the seeder behind app()->environment('local') or a dedicated seeder class so it can’t create privileged accounts in production.
Feature-flag the rollout. Wrap the admin routes and bypass gate behind a config flag (config('super-admin.enabled')) so you can disable the privileged layer without a redeploy if something goes wrong.
php artisan route:list) and that an unauthenticated/non-admin user is rejected — test with a plain user explicitly, not just the happy path.bigint users.id.php artisan config:clear locally and config:cache in deploy; stale config is the usual cause of routes silently missing.route:list --path=super-admin).How can I help you explore Laravel packages today?