phochs
phochs
FFilament
Created by phochs on 4/9/2025 in #❓┊help
Custom input fields not binding to class variables
What I am trying to do: Hello! It's my first time using custom field classes in Filament, and I'm running into a problem where the form fields I'm adding to the blade template are not getting bound to the variables in the object. What I did: I need a form field where the user can input a time that goes past midnight. Internally that would be for example 25:00, but in the form I want to represent that as 01:00 + 1 day. So what I tried to do is update the state based on the values of the input and select, so that internally it always returns a time. My issue/the error: The Filament inputs are not bound to the $this->timeField and $this->offsetField variables, so the fields never display anything, and updates from the fields are not passed to the class. When I try to print the variables in the Blade template, it gives an undefined variable error. Code: https://gist.github.com/phochs/4f5587cab9cc675c7e2a356add438346
9 replies
FFilament
Created by phochs on 4/25/2023 in #❓┊help
FileUpload component doesn't show uploaded image
3 replies