Skip to content

Upgrading from 4.0 to 4.1

In Sharp 4.0, it was allowed to declare the entity key, for menus, like this:

php
"menu" => [
    [
        "label" => "Equipment",
        "entities" => [
            "spaceship" => [
                "label" => "Spaceships",
                "icon" => "fa-space-shuttle"
            ]
        ]
    ]
]

The key => value array syntax is now forbidden, for consistency. The right way is:

php
"menu" => [
    [
        "label" => "Equipment",
        "entities" => [
            [
                "entity" => "spaceship",  // notice the change here
                "label" => "Spaceships",
                "icon" => "fa-space-shuttle"
            ]
        ]
    ]
]

Notice there is now a dedicated doc section for menus.

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, going from this:

php
return [
    "entities" => [
        [...]
    ],
    "dashboard" => \App\Sharp\Dashboard::class
];

to this:

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

Released under the MIT License.