Filament Studio supports dynamic field behavior based on conditions. Fields can be conditionally visible, required, or disabled based on form state, user permissions, page context, or custom logic.
React to the current value of another field in the form:
{
"type": "field_value",
"field": "status",
"operator": "equals",
"value": "published"
}
Available operators: equals, not_equals, in, not_in, is_empty, is_not_empty, greater_than, less_than, contains.
Check if the current user has a specific Laravel Gate permission:
{
"type": "permission",
"permission": "manage-pricing"
}
React to the current page context (creating a new record vs editing an existing one):
{
"type": "record_state",
"state": "create"
}
Valid states: create, edit.
Use custom logic registered via the plugin API:
{
"type": "external",
"resolver": "has_premium"
}
External resolvers are registered when configuring the plugin:
FilamentStudioPlugin::make()
->conditionResolver('has_premium', function () {
return auth()->user()->isPremium();
}, reactive: true);
The reactive parameter controls whether the form re-evaluates this condition on every change. Set to true for conditions that depend on form state.
Conditions can control three field behaviors:
Each behavior accepts an array of condition rules. Multiple rules within a behavior use AND logic — all must be satisfied.
The ConditionEvaluator service handles all condition logic. It:
->visible(), ->required(), ->disabled(), and ->dehydrated()->live() for reactive updatesThe evaluator includes static analysis to detect circular dependencies. If field A's visibility depends on field B, and field B's visibility depends on field A, the evaluator will detect and report the cycle.
$cycles = ConditionEvaluator::detectCycles($fields);
// Returns null if no cycles, or array describing the cycle path
External resolvers receive the current record state and authenticated user:
ConditionEvaluator::registerResolver(
key: 'is_business_hours',
resolver: function (array $recordState, ?User $user): bool {
$hour = now()->hour;
return $hour >= 9 && $hour < 17;
},
reactive: false
);
Or more commonly, through the plugin API:
FilamentStudioPlugin::make()
->conditionResolver('is_business_hours', function () {
return now()->hour >= 9 && now()->hour < 17;
});
How can I help you explore Laravel packages today?