Symfony 4 / Sonata: Create a second interface with the same entity

Here we will see how to create a second interface while the entity is already in use in a CRUD interface.

The problem with automatically generated interfaces is that they use the name of the entity to construct the routes.
If we configure a second interface with an entity that is already used, we will end up with the same route as the first.

To address this issue, we will use these two parameters in our admin class to override the default values.
Suppose we are using the entity "model", we could use the term "model2" (or toto, whatever you actually want)

    protected $baseRouteName = 'admin_vendor_app_modele2';
    protected $baseRoutePattern = 'modele2';

Do not forget to clear the cache properly so that the new routes are taken into account.