Using Spatie/Laravel-Data to validate Filament Forms
Is it possible to take advantage of Laravel Data to validate Filament forms?
Some projects require using Laravel Data for proper validation in different contexts (API, commands, jobs, etc), and it becomes redundant to duplicate validation rules in Filament forms for every resource. I'm looking for a way to integrate both effectively. Here's my current approach: While this basic implementation works for validation rules, it doesn't leverage other Laravel Data features like: - Custom validation messages - Type casting - Complex validations - Data Object reusability Has anyone found a more elegant solution to integrate these tools? Any advice or examples would be greatly appreciated!
Some projects require using Laravel Data for proper validation in different contexts (API, commands, jobs, etc), and it becomes redundant to duplicate validation rules in Filament forms for every resource. I'm looking for a way to integrate both effectively. Here's my current approach: While this basic implementation works for validation rules, it doesn't leverage other Laravel Data features like: - Custom validation messages - Type casting - Complex validations - Data Object reusability Has anyone found a more elegant solution to integrate these tools? Any advice or examples would be greatly appreciated!
0 Replies