# Upgrading from 4.0 to 4.1

## Dashboards were generalized

The "only one Dashboard" limitation is gone, bringing more control and features (policies). 
As a consequence, if you previously declared a Dashboard, you'll need to adapt your configuration
in `sharp.php`, [as documented here](/docs/dashboard.md), going from this:
    
    return [
        "entities" => [
            [...]
        ],
        "dashboard" => \App\Sharp\Dashboard::class
    ];

to this:

    return [
        "entities" => [
            [...]
        ],
        "dashboards" => [
            "dashboard" => [
                "view" => \App\Sharp\Dashboard::class
            ]
        ],
        [...]
        "menu" => [
            [
                "label" => "Company",
                "entities" => [
                    [
                        "label" => "My Dashboard",
                        "icon" => "fa-dashboard",
                        "dashboard" => "dashboard"
                    ],
                    [...]
                ]
            ]
        ]
    ];

# Upgrading from 4.0 to 4.1

## Deprecated syntax for menus configuration was removed

The menu section, in the documentation, no more accept the key => values syntax for entities.
As an example, given we defined the `events` entity, the deprecated syntax was:

    "menu" => [
        [
            "label" => "Scheduling",
            "entities" => [
                "events" => [
                    "label" => "Events",
                    "icon" => "fa-calendar"
                ],
            ],
        ]
    ],

And must be replace by (notice the events key was moved to an `entity` value):

    "menu" => [
        [
            "label" => "Scheduling",
            "entities" => [
                [
                    "label" => "Events",
                    "icon" => "fa-calendar",
                    "entity" => "events"
                ],
            ],
        ]
    ],


## Dashboards were generalized

The "only one Dashboard" limitation is gone, bringing more control and features (policies). 
As a consequence, if you previously declared a Dashboard, you'll need to adapt your configuration
in `sharp.php`, [as documented here](/docs/dashboard.md), going from this:
    
    return [
        "entities" => [
            [...]
        ],
        "dashboard" => \App\Sharp\Dashboard::class
    ];

to this:

    return [
        "entities" => [
            [...]
        ],
        "dashboards" => [
            "dashboard" => [
                "view" => \App\Sharp\Dashboard::class
            ]
        ],
        [...]
        "menu" => [
            [
                "label" => "Company",
                "entities" => [
                    [
                        "label" => "My Dashboard",
                        "icon" => "fa-dashboard",
                        "dashboard" => "dashboard"
                    ],
                    [...]
                ]
            ]
        ]
    ];

Document menu config syntax breaking change
Document menu config syntax breaking change
