Introduction:
InfixEdu is a comprehensive school management system designed to streamline academic and administrative processes for educational institutions. One of its key features is the Menu Management system, often referred to as Manu, which allows administrators to control the navigation structure of the platform efficiently.
The Menu Management (Manu) module enables super administrators and authorized users to customize the backend menus according to the roles and responsibilities within the institution. This means that different users—such as administrators, teachers, students, and parents—can have access to tailored menus relevant to their daily tasks.
With this system, users can:
Add, remove, or reorder menu items
Assign menu visibility based on user roles
Enable or disable specific menu options
Organize menus for better UX and workflow efficiency
Database Details:
Menus stored in ‘sm_menus’ table. In sm_menus table, It has total 20 columns Column details are listed below:
id (Big Integer) – id Column is the primary key of sm_menus table.
Name (string) – Name of the menu
Module (string) – If any menu is related to Module, the module name will be stored in this column. It is a nullable column
Route (string) – It will store the route name of a url. It is composary
Lang_name (string) – It will store Language key of menu
icon (strong) – It will store Icon class of font-awesome or others icon library
Status (integer)-- It will store menu status. While status is 0 the menus is disabled and if menu status is 1 the menu is enable
is_saas(integer)-- This column will store saas menu status. It will work when the saas module is enabled.
role_id(integer) – It will store users' role id. Student menus role id is 2, Parent / Guardian menus role id is 3 and others super admin, admin, teachers, Librarians, role id will be 1.
menu_status (integer) : It will store menu status. While status is 0 the menus is disabled and if menu status is 1 the menu is enable
permission_section(integer) – Permission section is a column indicating a section of menu like dashboard,administration, settings, Reports etc. If permission_section column value is 1 Then it is a section, and if value is 0 It is not a permission section.
position(integer) – Position column Indicates the position of menu.
default_position(integer): Default position column indicates the default position or default order of menu. If any user re-arrange the menu and then they want to reset the order in default then the position column value will be replaced with this default_position column value.
parent_id(integer): parent id is menu id which menu is parent of current menu.
school_id(integer): This column stores school id or institute id.
alternate_module(string): This column stores the module name of a menu that has an alternative menu on an alternative module. It store the Alternative module name
Igone(integer): Ignore column is not required.
permission_id: Permission id is a foreign key of the permissions table. IT stores the permission id from the permission table.
created_at(timestamp): It stores the created time of the menu.
updated_at(timestamp): It stores the updated time of the menu.
Add Menu
Before adding a new menu, the user must know under which parent menu the new menu should be placed. That is, whether the menu will be under a main menu or as a sub-menu of another existing menu.
To add a menu user needs to make a migration file to insert data on sm_menus table.
Example: The user has to add a menu called Shifts and shift setting and Shifts menus will be under the Administration section and Shift setting will be in Setting > General Settings menu.
public function up(): void
{
$menu = [
[
"name" => "Shifts",
"route" => 'shifts.index',
"module" => "",
"lang_name" => "common.shifts",
"icon" => "",
"is_alumni" => 1,
"is_saas" => 1,
"status" => 1,
"menu_status" => 1,
"permission_section" => 0,
"position" => 10, // display position of menu
"default_position" => 10, // default display position of menu
"parent_id" => 69080, //Administration section ID
"school_id" => 1,
"permission_id" => null, // Not required
"parent" => 69305,
"role_id" => 1, // If the menu for Student then role_id 2, If the menu is for Guardia / parent Then role id 3, If menu is for others then role id = 1
"alternate_module" => "", // Add Module name if has alternative module
],
[
"name" => "Shift Setting",
"route" => 'shift.setting',
"module" => "",
"lang_name" => "common.shift_setting",
"icon" => "",
"is_alumni" => 1,
"is_saas" => 1,
"status" => 1,
"role_id" => 1,
"menu_status" => 1,
"permission_section" => 0,
"position" => 25,
"default_position" => 25,
"parent_id" => 69305, //General Setting menu id
"school_id" => 1,
"permission_id" => null, // Not required
"parent" => 69305,
"alternate_module" => "", // Add Module name if has alternative module
],
];
DB::table('sm_menus')->insert($menu);
}