jwktje
jwktje
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
I figured it out already. Thanks for the quick help @Dennis Koch . I really appreciate it!
12 replies
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
Yep, it was as simple as that! Awesome. This works perfectly
->rule(function (callable $get) {
$locationId = $get('location_id');
$location = Location::find($locationId);
return 'dimensions:width='.$location->image_width.',height='. $location->image_height;
})
->rule(function (callable $get) {
$locationId = $get('location_id');
$location = Location::find($locationId);
return 'dimensions:width='.$location->image_width.',height='. $location->image_height;
})
Any idea on how to easily customize the error message if it fails?
12 replies
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
I will try with rule()
12 replies
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
Right! I tried using rules()
12 replies
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
I tried combining the closure rule with callable $get
12 replies
FFilament
Created by jwktje on 5/25/2023 in #❓┊help
Dynamic validation based on Select and FileUpload
That's what I was trying to do. But I wasn't able to get the current location selected in the custom validation. How can I get the value of another field in a fields custom rules()?
12 replies