Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Shield Enhanced Laravel Package

agroezinger/filament-shield-enhanced

Enhanced roles and permissions for Filament panels. Extends Filament Shield with a cleaner UI, granular permission management, and flexible configuration, so you can control access across resources, pages, and widgets with less setup and fewer surprises.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Assessment basis: v0.2.0 release notes; no prior assessment exists. Treat this as an initial evaluation, not a re-assessment.

Architecture fit. The package extends Filament Shield rather than replacing it, adding a third fine-grained permission category for arbitrary Livewire components that are not registered with a Filament panel. That is a meaningful architectural gap: Pages, Resources, and Widgets have panel registries to enumerate, but shared widgets included via @livewire(...) do not. The implementation follows Shield conventions: HasComponentShield trait, ComponentPermissionKeyBuilder using the same {Prefix}:{Action}:{Subject} key format as pages, a generator command, and a form component for the published RoleResource. The capability was extracted from a project-local fork, which suggests it is battle-tested in at least one real application, but also that the addon is still maturing.

Integration feasibility. Feasible for a Laravel/Filament/Shield/Spatie stack, but not drop-in. Adoption requires publishing or modifying RoleResource, adding traits to the authenticatable model and role form, configuring components.scan_paths, and running shield:generate-enhanced-components. The additive permission category means existing Page and Resource permissions should remain unaffected, so a staged pilot is practical. The main integration effort is establishing conventions for component discovery and permission keys, not the package install itself.

Technical risk. Moderate. Component discovery is scan-based because there is no registry; that is inherently heuristic and may miss dynamically aliased components, vendor components, anonymous components, or components outside configured paths. The key format can drift when components or actions are renamed, leaving stale permissions. The canShield() fix is operationally safer because missing permissions now return false instead of throwing PermissionDoesNotExist, but it also converts a loud misconfiguration into a silent denial. Routing through can() instead of Spatie's hasPermissionTo() may also change outcomes where Gate policies and Spatie permissions are not aligned. Pre-1.0 versioning implies API instability. The release notes do not state test coverage, supported Filament/Shield versions, or multi-tenancy behavior.

Key questions.

  • Which Filament, Shield, Laravel, PHP, and Spatie permission versions are supported and tested?
  • Does component scanning resolve @livewire('alias') usage, class references, and namespaced components, or only PHP classes under configured paths?
  • How are component permission subjects named to avoid collisions with Page and Resource keys?
  • Does the can() fallback consistently consult Gate policies, and what happens when a Gate policy and a Spatie permission disagree?
  • Is there a supported upgrade path for existing published RoleResource customizations?
  • What is the test matrix, and is there a semver or deprecation policy before 1.0?
  • How does the role form perform with hundreds or thousands of generated component permissions?
  • Are permissions global, or can they be scoped per tenant/team if the host application uses multi-tenancy?

Integration Approach

Stack fit. The package is designed for Laravel applications using Filament Shield and Spatie permissions. It fits best where non-panel Livewire components are shared across pages and currently rely on ad hoc Gate checks or manual permission strings. If the application has no such components, the new category adds complexity without corresponding value.

Migration path. Treat v0.2.0 as an additive pilot. Install and pin the version in a non-production environment, publish the package assets/configuration, and diff the published RoleResource against the existing application copy. Add HasComponentShield to the relevant user model and HasEnhancedRoleForm to the role form. Configure components.scan_paths to include only application-owned component directories, run shield:generate-enhanced-components, assign the generated permissions to a test role, and verify both allowed and denied access paths for a representative shared widget. Existing Page and Resource permissions should not need regeneration, but the canShield() behavior change should be tested explicitly for users with missing or renamed permissions.

Compatibility. Confirm the package's Filament and Shield major-version compatibility before adoption. Check whether the host application has customized RoleResource or overridden Shield's role form; merging EnhancedComponentPermissionsForm into a heavily customized resource is the most likely integration friction. Confirm that components.scan_paths covers the actual component layout, including module or package directories if used. Audit any code that depended on PermissionDoesNotExist being thrown; the new fallback to false changes error handling semantics.

Sequencing.

  1. Dependency and compatibility audit; pin the package version.
  2. Staging install and configuration of components.scan_paths.
  3. Add HasComponentShield and HasEnhancedRoleForm; reconcile RoleResource customizations.
  4. Run the component permission generator and review generated keys for collisions and stale entries.
  5. Update role assignment UI and seed a pilot role with component permissions.
  6. Test authorization matrix: generated permission, missing permission, renamed permission, Gate-policy-only path, super-admin bypass.
  7. Roll out to one team or panel, document the regeneration runbook, then expand.

Operational Impact

Maintenance. The generator must be rerun whenever components, actions, or scan paths change. That creates a recurring maintenance task and a drift risk between code and permission rows. Stale permissions should be reviewed periodically. Because the package is pre-1.0, expect upgrade work; pinning versions and tracking release notes is necessary.

Support. The package has a smaller support surface than Filament Shield itself and originates from a project-local fork. Internal ownership is required: someone must understand the key format, generator behavior, and RoleResource integration. External documentation may lag the code. Upgrades to Filament or Shield should trigger a compatibility check against this addon.

Scaling. Permission count grows with components multiplied by actions. That affects the role editing UI, permission table size, and Spatie's permission cache. The scan-based generator itself is a build-time concern and should scale acceptably, but the role form may need grouping, search, or pagination for large permission sets. Multi-tenant installations need a clear decision on whether component permissions are global or tenant-scoped.

Failure modes.

  • A component is missed by scanning, so no permission is generated and access is silently denied.
  • A component or action is renamed, leaving stale permissions and causing canShield() to return false.
  • RoleResource is not updated with EnhancedComponentPermissionsForm, so administrators cannot assign the new permissions.
  • Gate policies and Spatie permissions diverge, and the new can() routing produces different authorization outcomes.
  • The canShield() fix masks a missing generator run because the previous exception is no longer raised.
  • Published view or form overrides conflict with future package upgrades.

Ramp-up. The team needs working knowledge of Shield's permission key model, Filament panel versus non-panel Livewire components, and the regeneration workflow. A short enablement session plus an internal runbook covering "add component, configure path, regenerate, assign role, verify denial" is sufficient for a pilot. Broad rollout should wait until the authorization matrix and upgrade path are validated in staging.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core