EasyAdmin! For an Awesomely Powerful Admin Area
Fields on some Pages, not Others
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Which fields will be rendered on the "detail" page of InvoiceCrudController if you have this config:

class InvoiceCrudController extends AbstractCrudController
{
    // ...
    public function configureFields(string $pageName): iterable
    {
        yield IdField::new('id')
            ->onlyOnIndex();
        yield MoneyField::new('total')
            ->setCurrency('USD');
        if ($pageName === 'detail') {
            yield EmailField::new('user.email', 'Email');
            yield BooleanField::new('wasEmailSent')
                ->onlyOnIndex()
                ->renderAsSwitch(false);
        }
        yield DateField::new('createdAt')
            ->hideOnForm();
        yield DateField::new('paidAt');
    }
}
Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.