You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-5Lines changed: 36 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,41 @@ class ContentResource extends Resource
137
137
}
138
138
```
139
139
140
+
### Field Configuration
141
+
142
+
#### Validation Rules
143
+
144
+
Each field supports validation rules that can be configured through the admin interface. The package includes support for all standard Laravel and Filament validation rules:
-**Pattern Rules**: Regex, starts/ends with, in/not in list
153
+
-**Database Rules**: Exists, unique
154
+
155
+
##### Field Dependencies
156
+
157
+
Validation rules can depend on other fields in the form:
158
+
159
+
-**Field Comparison**: Compare values with other fields (`same`, `different`, `greater_than`, etc.)
160
+
-**Conditional Requirements**: Make fields required based on other field values (`required_if`, `required_unless`)
161
+
-**Multi-field Dependencies**: Require fields based on multiple other fields (`required_with_all`, `required_without_all`)
162
+
163
+
When no other fields are available for dependency rules, the field selection will be disabled and show a helpful message.
164
+
165
+
#### Visibility Rules
166
+
167
+
Control when fields are shown or hidden based on conditions:
168
+
169
+
-**Conditional Display**: Show/hide fields based on other field values
170
+
-**Dynamic Forms**: Create adaptive forms that change based on user input
171
+
-**Complex Logic**: Support for multiple conditions and logical operators
172
+
173
+
The visibility system works seamlessly with validation rules to create intelligent, user-friendly forms.
174
+
140
175
### Making a resource page configurable
141
176
142
177
To make a resource page configurable, you need to add the `CanMapDynamicFields` trait to your page. For this example, we'll make a `EditContent` page configurable.
@@ -146,11 +181,7 @@ To make a resource page configurable, you need to add the `CanMapDynamicFields`
0 commit comments