Complex Multi-Group Form

Filament 4/5
Also available in Filament 3 version

This project illustrates the implementation of grouped checkboxes with mutually exclusive selection constraints. Using a task creation scenario, it allows assignment to either a user, a group, or a role, ensuring selections can only be made within one category at a time.

h9NhGMG4UJnwlCxsY054jRVmnlkCbf-metaMTctY29tcGxleC1tdWx0aS1ncm91cC1mb3JtLnBuZw==-

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Complex Multi-Group Form
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 173 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 173 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

The main logic here lives between form() method on our Resource and the create and edit functions

  • Three different groups of checkboxes - Users, Groups, Positions
  • Each group has a set of checkboxes that can't be mixed. For example, if you selected Users, you can't select any other group
  • Each of the checkbox is reactive and generated real-time for the form.
  • There is a hydration logic for the checkboxes, so that when you edit the form, the checkboxes are pre-selected.
  • We will override the input format on both create and edit actions using CreateTask and EditTask files to fit our new format and save relationships manually

Here's how that looks in our form() method:

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.