Easyadmin 3 field disabled/read-only

Viewed 4571

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!

3 Answers

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!

Related