is there any chance to disable an field to user using EasyAdmin's implemented fields?
I would like to show to user a boolean value of "isPaid", but i don't want him to change it, just show him (the payment gateway does this)
Thanks for your help!
is there any chance to disable an field to user using EasyAdmin's implemented fields?
I would like to show to user a boolean value of "isPaid", but i don't want him to change it, just show him (the payment gateway does this)
Thanks for your help!
What you are probably looking for is this:
BooleanField::new('isPaid')->setFormTypeOption('disabled','disabled');
Actually all i needed and wanted is this:
public function configureFields(string $pageName): iterable
{
...
$isPaid = BooleanField::new('isPaid')->renderAsSwitch(false)->hideOnForm();
...
}
Thanks for your help anyway!
You can customize the template used to render each property, but I guess you should use this with Security Voters to be sure that a user cannot alter form to force and submit hacked data.