Navigation menu

Navigation menu in ikpanel is fully customizable. You can add or every item within the "menu" table.

There's two kinds of element that you can implement: folder and item.

+ Settings <folder>
    - User  <item>
    - Role <item>
    - Widget <item>
+ Article <folder>
    - new <item>
    - edit <item>    

# Item

Items are the main navigation tool. It's used to navigate in our application. To add a new item you've just to create new migration/seed like the following.

class NewItem extends Migration {

    public function up(){
    
        // Create new item in navigation menu
        Menu::insert([
            'id'       => 'USERS',
            'id_token' => 'MANAGE_USER',
            'name'     => 'Manage users',
            'route'    => '/users',
            'icon'     => 'fas fa-users',
            'relation' => null
        ]);
    }
    
    public function down(){
        Menu::where('id','=','USERS')
            ->delete()
    }

}

# Folder

A folder is an item without a link. It's usually used to create a group of link. You can create a new folder with a new migration/seed.

class NewFolder extends Migration {

    public function up(){
    
        // Create new folder in navigation menu
        Menu::insert([
            'id'       => 'FOLDER_SETTINGS',
	        'id_token' => 'SHOW_SETTINGS',
	        'name'     => 'Settings',
	        'route'    => null,
	        'icon'     => 'fas fa-cogs',
	        'relation' => null
        ]);
    }
				
    public function down(){
        Menu::where('id','=','FOLDER_SETTINGS')
            ->delete();
    }    
}

# Add item inside folder

You can add items inside a folder by adding a folder foreign key in relation column.

Menu::insert([
    'id'       => 'USERS',
    'id_token' => 'MANAGE_USER',
    'name'     => 'Manage users',
    'route'    => '/users',
    'icon'     => 'fas fa-users',
    'relation' => 'FOLDER_SETTINGS' // Folder foreign key
]);

Last updated

Was this helpful?