Skip to main content
This is documentation for Shopper v1, which is no longer maintained. Please refer to the v2 docs for the latest information.
The Control Panel navigation is quite customizable. You can add your own sections, pages, and subpages, as well as remove and modify existing ones. The navigation is controlled by the package maatwebsite/laravel-sidebar. You need to create a sidebar to add your menus within the main sidebar of Shopper. You may register your sidebar like event in the register() method of a service provider.

Adding Navigation

Let’s assume we’re creating a Sidebar folder under app folder, and want to add a Blog navigation item to the Content section of the navigation. To add this item, we’ll create first a BlogSidebar class. There is no command to create this class so you have to create it manually and it must extend from Shopper\Framework\Sidebar\AbstractAdminSidebar We will have an architecture similar to this one
We assume here that you have already seen how to add routes for our administration explained in this section.
Here we will assume that our routes/shopper.php file contains this
You cannot use the notation [PostController::class, 'index'] because this will not load and will generate an error. Everything is loaded directly from the RouteServiceProvider of Shopper
Our BlogSidebar will look like this
Now we will register our sidebar in our AppServiceProvider with the register() method
We will have this in our sidebar
Blog sidebar

The Menu & Item Class

Each item you see in the navigation is an instance of the Maatwebsite\Sidebar\Item class. Each top-level Menu in a section can contain its own group of Item children.

Basic API

The code examples above demonstrate how to add Navigation. Once you have a Item object, the following chainable methods are available to you: