src/Configuration/DefaultConfigPass.php
private function processDefaultHomepage(array $backendConfig)
    {
        $backendHomepage = [];

        // if no menu item has been set as "default", use the "list"
        // action of the first configured entity as the backend homepage
        if (null === $menuItemConfig = $backendConfig['default_menu_item']) {
            $defaultEntityName = $backendConfig['default_entity_name'];
            $backendHomepage['route'] = 'easyadmin';
            $backendHomepage['params'] = ['action' => 'list', 'entity' => $defaultEntityName];

            // if the default entity defines a custom sorting, use it
            $defaultEntityConfig = isset($backendConfig['entities'][$defaultEntityName]) ? $backendConfig['entities'][$defaultEntityName] : [];
            if (isset($defaultEntityConfig['list']['sort'])) {
                $backendHomepage['params'] = \array_merge($backendHomepage['params'], [
                    'sortField' => $defaultEntityConfig['list']['sort']['field'],
                    'sortDirection' => $defaultEntityConfig['list']['sort']['direction'],
                ]);
            }
        } else {
            $routeParams = ['menuIndex' => $menuItemConfig['menu_index'], 'submenuIndex' => $menuItemConfig['submenu_index']];

            if ('entity' === $menuItemConfig['type']) {
                $backendHomepage['route'] = 'easyadmin';
                $backendHomepage['params'] = \array_merge(['action' => 'list', 'entity' => $menuItemConfig['entity']], $routeParams, $menuItemConfig['params']);
            } elseif ('route' === $menuItemConfig['type']) {
                $backendHomepage['route'] = $menuItemConfig['route'];
                $backendHomepage['params'] = \array_merge($routeParams, $menuItemConfig['params']);
            } elseif ('link' === $menuItemConfig['type']) {
                $backendHomepage['url'] = $menuItemConfig['url'];
            }
        }

        $backendConfig['homepage'] = $backendHomepage;

        return $backendConfig;
    }
private function processDefaultHomepage(array $backendConfig)
    {
        $backendHomepage = [];

        // if no menu item has been set as "default", use the "list"
        // action of the first configured entity as the backend homepage
        if (null === $menuItemConfig = $backendConfig['default_menu_item']) {
            $defaultEntityName = $backendConfig['default_entity_name'];
            $backendHomepage['route'] = 'easyadmin';
            $backendHomepage['params'] = ['action' => 'list', 'entity' => $defaultEntityName];

            // if the default entity defines a custom sorting, use it
            $defaultEntityConfig = isset($backendConfig['entities'][$defaultEntityName]) ? $backendConfig['entities'][$defaultEntityName] : [];
            if (isset($defaultEntityConfig['list']['sort'])) {
                $backendHomepage['params'] = \array_merge($backendHomepage['params'], [
                    'sortField' => $defaultEntityConfig['list']['sort']['field'],
                    'sortDirection' => $defaultEntityConfig['list']['sort']['direction'],
                ]);
            }
        } else {
            $routeParams = ['menuIndex' => $menuItemConfig['menu_index'], 'submenuIndex' => $menuItemConfig['submenu_index']];

            if ('entity' === $menuItemConfig['type']) {
                $backendHomepage['route'] = 'easyadmin';
                $backendHomepage['params'] = \array_merge(['action' => 'list', 'entity' => $menuItemConfig['entity']], $routeParams, $menuItemConfig['params']);
            } elseif ('route' === $menuItemConfig['type']) {
                $backendHomepage['route'] = $menuItemConfig['route'];
                $backendHomepage['params'] = \array_merge($routeParams, $menuItemConfig['params']);
            } elseif ('link' === $menuItemConfig['type']) {
                $backendHomepage['url'] = $menuItemConfig['url'];
            }
        }

        $backendConfig['homepage'] = $backendHomepage;

        return $backendConfig;
    }
Processes the backend config to define the URL or the route/params to
use as the default backend homepage when none is defined explicitly.
(Note: we store the route/params instead of generating the URL because
the 'router' service cannot be used inside a compiler pass).

@param array $backendConfig

@return array