Filament Documentation (Legacy Site)

repository·main·Indexed 43 days ago

https://github.com/filamentphp/legacy-site

Archived documentation and articles for Filament, featuring guides on v3.1 global dashboard filters, CSV imports, and query builders, as well as previews of Filament v4 features including nested resources, built-in MFA, and unified schemas.

Tokens
37.7K
Snippets
112
Records
196
Agent score
55%

What's inside Filament

  1. Overview of SolutionForest Filaletter

    main
    Filaletter is an email marketing plugin designed specifically for the FilamentPHP admin panel. It allows you to manage email marketing campaigns, subscribers, and mailing lists directly within your Filament environment. It is built upon the open-source Sendportal core project and focuses on providing a seamless, flexible, and user-friendly experience for content distribution via email.
  2. Overview of Data Lens for Filament

    main

    Data Lens is a premium reporting and visualization solution designed for Laravel Filament. It allows developers to transform raw data into actionable insights through dynamic reporting, custom dashboards, and automated insights without writing complex manual queries.

    Key capabilities include:

    • Dynamic Column Builder: Traverse models and relationships to select columns.
    • Advanced Filtering: Create complex filter conditions using nested logic and multiple operators.
    • Smart Summaries: Use aggregations like COUNT, SUM, AVG, and MIN/MAX.
    • Interactive Widgets: Display data via stats cards, bar charts, line graphs, and pie charts.
    • Flexible Exports: Export reports to CSV or XLSX (supports queue support for large datasets).
    • Email Scheduling: Automate report delivery on daily, weekly, or monthly schedules.
    • Security & Multi-tenancy: Built-in authorization, sensitive column auto-detection, and seamless integration with Filament's multi-tenancy features.
  3. Implement a SaaS Invoicing System with Filament v4

    main

    This implementation plan outlines how to build a single-tenant admin panel for managing customers, products, invoices, and payments using Filament v4. The system supports manual invoice sending, partial payments, and in-app notifications.

    Key features include:

    • Customer Management: Tracking contact and address details.
    • Product Catalog: Managing SKUs and unit prices (stored in cents).
    • Invoice Lifecycle: Creating drafts, sending invoices, and recording payments.
    • Automated Calculations: Using Repeaters for line items to auto-calculate subtotals, taxes, and totals.
  4. Plugin submission requirements and common errors

    main

    When submitting a plugin to the Filament directory, ensure you adhere to these standards to avoid common review feedback:

    • Purpose: Documentation must clearly explain what the plugin does, ideally with screenshots or examples.
    • Casing: Always use proper capitalization for "Filament" and "FilamentPHP".
    • Categorization: Choose valid categories from the available categories list.
    • Scope: Ensure the submission is a specific Filament plugin rather than a general Laravel package.
    • Design: Plugin design should align with the aesthetic of existing plugins on the website.
  5. Planned features in Filament v3.2

    main

    Filament v3.2 is planned to introduce several quality-of-life improvements and new components. Key features include:

    • Reveal-able Password Inputs: Allows users to toggle password visibility within the input field.
    • New Toggle Button UI: An alternative UI component for radio buttons and checkboxes.
    • Split Component for Forms: Brings the Split layout component (previously available in Infolists) to the Forms package.
    • “Wait, Don't Leave!” Functionality: An alert that triggers if a user attempts to navigate away from a page while a form is unsaved or a confirmation modal is open.
    • Apply Button for Filters: Allows users to defer filter query processing until they explicitly click an 'Apply' button, rather than running a query on every individual change.
    • CSV Exports: Adds CSV export capabilities to complement the CSV imports introduced in v3.1.
  6. Upcoming Filament Theming and UI improvements

    main

    Future updates to Filament's UI and theming engine aim to improve developer experience and performance:

    • Theming API Updates: Improvements to how Tailwind classes are handled to resolve CSS specificity issues and reduce the HTML payload size sent via Livewire.
    • Filament Component Explorer: A tool (similar to Storybook) to help developers discover, view, and copy/paste Blade components for use in TALL-stack projects.
    • Volt Integration: Providing Volt APIs or minimal wrappers for Filament packages to support single-file Livewire components.
    • Headless Filament: An exploration into providing 'headless' UI components, allowing developers to bring their own custom styles while leveraging Filament's logic.
  7. Use the Query Builder for Complex Filtering

    main

    The Query Builder allows users to create advanced, multi-dimensional queries through a UI. It supports:

    • Operators: AND, OR, and NOT (negation).
    • Field Types: Text, Boolean, Date, and Number.
    • SelectConstraint: Filters a column using options from a Select field.
    • RelationshipConstraint: Filters fields based on data from a related model (similar to whereHas).

    Constraints are added to tables to let users build custom queries on the fly.

  8. How Schemas work in Filament

    main

    Schemas are the foundation of Filament's Server-Driven UI. They allow you to build interfaces using PHP configuration objects instead of manual HTML/JS.

    A schema is represented by a Filament\Schemas\Schema object. You define the UI by passing an array of components to the components() method.

    Schemas can represent:

    • Form fields
    • Infolist entries
    • Layout components
    • Prime components
    $schema->components([
        // array of components
    ]);
  9. Extend Contact Form functionality with Hooks

    main

    You can add custom logic before or after a form is submitted by extending the ContactFormListener class and implementing the required handler methods.

    1. Create a listener class extending Solutionforest\SimpleContactFormPro\Listeners\ContactFormListener.
    2. Implement handleContactFormCreating(BeforeCreateContactForm $event) for pre-submission logic.
    3. Implement handleContactFormCreated(AfterCreateContactForm $event) for post-submission logic.
    4. Register the listener in config/simple-contact-form-pro.php under the events key.

    Note: In Laravel 11+, if you place your listener in app/Listeners, it may be registered automatically. If you manually register it in the config as well, the event might run twice.

    namespace App\Listeners;
    
    use Solutionforest\SimpleContactFormPro\Listeners\ContactFormListener;
    use Solutionforest\SimpleContactFormPro\Events\BeforeCreateContactForm;
    use Solutionforest\SimpleContactFormPro\Events\AfterCreateContactForm;
    
    class YourCustomListener extends ContactFormListener
    {
        public function handleContactFormCreating(BeforeCreateContactForm $event): void
        {
           // custom logic before record create
        }
    
        public function handleContactFormCreated(AfterCreateContactForm $event): void
        {
           // custom logic after record create
        }
    }