polashmahmud/dishari
Composer 安装命令:
composer require polashmahmud/dishari
包简介
A dynamic menu builder for Laravel Inertia Vue Shadcn projects.
README 文档
README
Dishari Menu Management
A powerful and flexible menu management package for Laravel applications built with Inertia.js and Vue 3. This package provides a drag-and-drop interface for managing nested menus, complete with icon support, groups, and active status toggling.
Features
- 📱 Drag & Drop Interface: Intuitive UI for reordering and nesting menu items.
- 🌳 Nested Structure: Support for unlimited levels of nested submenus.
- 📂 Menu Groups: Organize menus into logical groups (e.g., Platform, Settings).
- 🎨 Icon Integration: Built-in support for Lucide icons with a searchable picker.
- ⚡ Inertia.js & Vue 3: Seamless integration with modern Laravel stacks.
- 🛠 Fully Customizable: Publishable Vue components to match your application's design.
Installation
1. Require the Package
Install the package via Composer:
composer require polashmahmud/dishari
2. Run the Installer
Run the dishari:install command to publish the configuration, migrations, and frontend assets.
php artisan dishari:install
During installation, you will be asked to provide a directory name (default: dishari).
This determines where the frontend files will be published:
- Pages:
resources/js/pages/{directoryName} - Components:
resources/js/components/{directoryName}
3. Run Migrations
Run the migrations to create the menu tables:
php artisan migrate
4. Compile Assets
Recompile your assets to include the new components:
npm run dev
Frontend Integration
To display the dynamic menu in your application, you need to update your Sidebar component (usually resources/js/components/AppSidebar.vue or similar).
1. Update Menu Data Source
Locate your sidebar component and replace the static menu items with the useDishari hook.
Remove static data like this:
const mainNavItems: NavItem[] = [ { title: 'Dashboard', href: dashboard(), icon: LayoutGrid, }, ];
Add the dynamic hook:
import { useDishari } from '@/lib/useDishari'; const { menus: mainNavItems } = useDishari();
2. Import the NavMain Component
You need to import the NavMain component that was published to your project. The path depends on the directory name you chose during installation.
If you chose dishari (default):
import NavMain from '@/components/dishari/NavMain.vue';
If you chose menu:
import NavMain from '@/components/menu/NavMain.vue';
Full Example (AppSidebar.vue):
<script setup lang="ts"> import { useDishari } from '@/lib/useDishari'; // Import from the folder you chose during installation (e.g., 'dishari' or 'menu') import NavMain from '@/components/dishari/NavMain.vue'; const { menus: mainNavItems } = useDishari(); </script> <template> <Sidebar> <SidebarContent> <!-- Pass the dynamic items to the component --> <NavMain :items="mainNavItems" /> </SidebarContent> </Sidebar> </template>
Usage
Accessing the Management Interface
Once installed, you can access the menu management interface at:
/menu-management
Configuration
The configuration file is located at config/dishari.php. You can customize the directory name, cache settings, and authentication requirements.
return [ 'directory_name' => 'dishari', // The folder name for published Vue files 'auto_share' => true, // Automatically share menu data with Inertia // ... ];
Requirements
- PHP 8.2+
- Laravel 11+
- Inertia.js
- Vue 3
- Tailwind CSS
- Shadcn Vue (recommended)
License
The MIT License (MIT). Please see License File for more information.
polashmahmud/dishari 适用场景与选型建议
polashmahmud/dishari 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 polashmahmud/dishari 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 polashmahmud/dishari 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-05