oliverde8/comfy-easy-admin-bundle

Add interfaces to edit comfy configurations in easy admin.

1.0.0-alpha3 2021-08-24 15:17 UTC

This package is auto-updated.

Last update: 2024-04-05 14:23:50 UTC


README

Scrutinizer Code Quality Build Status Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

This bundle adds the edition interface to easy admin so that admins can configure their site using comfy bundle.

Check Comfy bundles documentation here alt text

Install

composer require oliverde/comfy-easy-admin-bundle

To add a link to the menu edit your DashnoardController to inject the MenuConfigurator service:

protected MenuConfigurator $menuConfigurator;

/**
 * DashboardController constructor.
 * @param ConfigInterface $testConfig
 */
public function __construct(MenuConfigurator $menuConfigurator)
{
    $this->menuConfigurator = $menuConfigurator;
}

and now add the Menu link

    public function configureMenuItems(): iterable
    {
        /** Other menu elements .... */
        yield $this->menuConfigurator->getMenuItem();
    }

Finally add the add router.

comfy_bundle:
    resource: '@oliverde8ComfyEasyAdminBundle/Controller'
    type: annotation
    prefix: /admin

You are ready to go, to create configuration elements check comfy bundles documentation

Permissions

By default any one with access to the EasyAdmin interface can edit any configuration.

To limit this rewrite the ConfigEditVoter service with your own.

TODO

  • Allow separate view & edit permission.