Weave Code
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 Cards Laravel Package

harvirsidhu/filament-cards

Turn any Filament page into a card-based navigation hub. Auto-discovers Cluster/Resource pages, respects navigation config, checks authorization, and supports grouping, columns/spans, visibility rules, manual links, and optional search—ideal for settings hubs and dashboards.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Filament-Native Integration: The package leverages Filament’s existing patterns (label, schema, visible, hidden, columnSpan), ensuring seamless adoption without disrupting the current architecture. It extends Filament’s navigation system rather than replacing it, making it ideal for projects already using Filament v4/v5.
  • Cluster/Resource Alignment: Designed to work natively with Filament’s Clusters and Resources, reducing friction for projects using these organizational structures. Auto-discovery of pages/resources minimizes manual configuration.
  • Modularity: Supports dynamic registration (via service providers) and mixed manual/auto-discovered cards, allowing incremental adoption. This is critical for large-scale applications with modular architectures.

Integration Feasibility

  • Low-Coupling: The package does not modify core Filament or Laravel files; it integrates via hooks (showInFilamentCards, getFilamentCardsGroup) and API methods (discoverClusterCards, discoverResourceCards). This minimizes merge conflicts and testing overhead.
  • Theme Compatibility: Requires Tailwind CSS integration (via theme.css), which is standard for Filament projects. No additional frontend frameworks or build tools are needed.
  • Authorization Awareness: Respects Filament’s canAccess() checks, ensuring cards are only visible to authorized users. This aligns with Laravel’s gate/policy system.

Technical Risk

  • Version Lock: Requires PHP 8.2+, Laravel 11+, and Filament v4/v5. Projects using older versions will need upgrades, which may introduce compatibility risks (e.g., deprecated APIs, breaking changes in Filament’s navigation system).
  • Auto-Discovery Edge Cases:
    • False Positives: Auto-discovery may include unintended pages/resources if showInFilamentCards() is not explicitly set. Requires careful testing of exclusion logic ($excludedClusterComponents, $excludedResourcePages).
    • Dynamic Content: Pages/resources with runtime-generated navigation labels (e.g., via closures) may not render correctly in cards unless explicitly handled.
  • Performance:
    • Auto-Discovery Overhead: Scanning all Cluster/Resource pages at runtime could impact load times for large applications. Mitigation: Use lazy loading or caching (e.g., cache the card list in a service provider).
    • Search Functionality: Client-side search (optional) adds JavaScript dependencies. Ensure your Filament theme supports dynamic updates without full page reloads.

Key Questions

  1. Navigation Strategy:
    • How does this package interact with Filament’s existing sidebar navigation? Will users have duplicate entries (sidebar + cards)? If so, how will visibility be managed (e.g., hide sidebar items via shouldRegisterNavigation())?
    • Does the package support nested clusters or multi-level card groups? If not, will this require custom extensions?
  2. Authorization Granularity:
    • Can card-level permissions be fine-grained (e.g., per-user or per-role)? The package uses canAccess(), but does it support Filament’s new canAccessPage() or custom gate closures?
  3. Scalability:
    • How will performance degrade with thousands of auto-discovered cards? Are there pagination or virtual scrolling options?
    • Does the package support server-side filtering (e.g., search/filter before rendering cards) to reduce client-side load?
  4. Customization Limits:
    • Can card layouts be fully customized (e.g., custom icons, dynamic badges, or interactive elements)? The API seems limited to predefined methods.
    • Is there a way to override the default Tailwind styling without forking the package?
  5. Testing and Debugging:
    • How are auto-discovery failures logged or surfaced? For example, if a page’s navigationLabel is missing, how is this communicated to developers?
    • Are there pre-built test cases for common edge cases (e.g., hidden pages, dynamic URLs)?

Integration Approach

Stack Fit

  • Filament v4/v5: Perfect fit due to shared navigation patterns and Cluster/Resource integration. No additional middleware or plugins are required beyond the package itself.
  • Laravel Ecosystem: Works seamlessly with Laravel’s authorization (canAccess()), service providers, and view composers. No Laravel-specific modifications are needed.
  • Tailwind CSS: Required for styling, but this is already a dependency for Filament projects. The package provides minimal CSS overrides, reducing customization effort.

Migration Path

  1. Assessment Phase:
    • Audit existing Filament Clusters, Resources, and Pages to identify candidates for card-based navigation.
    • Document current navigation flows (e.g., sidebar depth, breadcrumbs) to ensure consistency post-integration.
  2. Pilot Implementation:
    • Start with a non-critical Cluster (e.g., Settings) to test auto-discovery and manual card mixing.
    • Gradually replace sidebar-heavy pages with CardsPage equivalents, using discoverClusterCards() for auto-generated cards.
  3. Incremental Rollout:
    • Phase 1: Replace static sidebar pages with CardsPage (Use Case C).
    • Phase 2: Implement Cluster/Resource hubs (Use Case A/B) for better organization.
    • Phase 3: Introduce dynamic registration for modular packages (e.g., third-party Filament plugins).
  4. Deprecation:
    • Phase out legacy sidebar navigation for clusters where cards provide a better UX (e.g., settings hubs).
    • Use Filament’s shouldRegisterNavigation() to hide redundant sidebar entries.

Compatibility

  • Filament Plugins: The package supports dynamic registration, making it compatible with Filament plugins that add pages/resources at runtime. Example:
    // In a service provider
    FilamentCards::registerDynamicCard(
        CardItem::make(MyPluginPage::class)
    );
    
  • Third-Party Packages: No known conflicts with other Filament packages (e.g., Spatie Laravel Permission, Filament Tables). However, test with packages that modify Filament’s navigation system (e.g., custom sidebar renderers).
  • Legacy Code: Pages/resources without navigationLabel or navigationIcon will fall back to class names, which may require cleanup.

Sequencing

  1. Prerequisites:
    • Upgrade to PHP 8.2+, Laravel 11+, and Filament v4/v5 if not already compliant.
    • Ensure Tailwind CSS is properly configured (check theme.css and postcss.config.js).
  2. Core Integration:
    • Install the package via Composer and publish assets (npm run build).
    • Create a base CardsPage for your first Cluster/Resource.
  3. Auto-Discovery Setup:
    • Configure discoverClusterCards() or discoverResourceCards().
    • Test exclusion logic ($excludedClusterComponents) to avoid unintended cards.
  4. Manual Customization:
    • Add CardGroup and CardItem for non-auto-discovered entries (e.g., external links).
    • Override labels, icons, and descriptions where needed.
  5. Advanced Features:
    • Enable client-side search ($searchable = true).
    • Implement dynamic registration for modular apps.
  6. Testing:
    • Verify authorization checks (canAccess()) for all cards.
    • Test responsive layouts (columnSpan on mobile/desktop).

Operational Impact

Maintenance

  • Low Ongoing Effort:
    • Auto-discovery reduces manual updates. Changes to Cluster/Resource pages automatically reflect in cards.
    • Centralized exclusion lists ($excludedClusterComponents) simplify maintenance.
  • Dependency Management:
    • The package is MIT-licensed and actively maintained (last release: 2026-05-04). Monitor for breaking changes in Filament v5.
    • No external APIs or services are required, reducing third-party risk.
  • Documentation:
    • Comprehensive README with use case examples and API references. However, lack of dependents (0) suggests limited real-world testing; expect to document custom edge cases internally.

Support

  • Troubleshooting:
    • Auto-Discovery Issues: Use dd(static::discoverClusterCards()) to debug why pages are included/excluded.
    • Styling Problems: Tailwind classes are well-documented, but custom overrides may require inspecting the package’s Blade templates (vendor/harvirsidhu/filament-cards/resources/views).
    • Authorization Errors: Ensure canAccess() is implemented correctly on target pages/resources.
  • Community:
    • Limited community (9 stars, 0 dependents). Support may require opening GitHub issues or forking for custom needs.
    • Filament’s official Slack/Discord may have more active discussions.

Scaling

  • Performance:
    • Auto-Discovery: Scanning all Cluster/Resource pages at runtime could slow down initial page load. Mitigate by:
      • Caching the card list in a service provider (e.g., using Laravel’s cache).
      • Using **lazy loading
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope