承接 esanj/layout-master 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

esanj/layout-master

Composer 安装命令:

composer require esanj/layout-master

包简介

The ultimate template for web applications

README 文档

README

A Laravel scaffolding package that drops a ready‑made, Vuexy‑inspired admin layout into your app: a master Blade layout, header/menu/footer sections, reusable components, a permission‑aware dynamic menu, and the Vite/SCSS build configuration.

Everything is published into your project so you fully own and can customize it. The package itself only ships the files and one install command — it registers no routes or runtime views.

Supports: Laravel 10 · 11 · 12 · 13 — PHP 8.2+

✨ Features

  • 🎨 Pre‑built Vuexy master layout with header, horizontal menu, and footer.
  • 🧩 Dynamic JSON menu with unlimited nested submenus, icons, badges, and per‑item permissions.
  • 🔒 Permission‑aware menu links powered by esanj/managers.
  • 🧱 Reusable Blade components: <x-menu>, <x-sub-menu>, <x-alert-message>, <x-error>.
  • ⚡ Vite + SCSS build config, with auto‑discovered per‑page JS/SCSS.

⚠️ Important: this is a Vuexy scaffold, not the full theme

This package provides the layout, components, menu, and build config — plus a handful of source assets (config.js, main.js, demo.css, CodeMirror SCSS). It does not bundle the full Vuexy theme source.

The published head/scripts sections and vite.config.js reference the Vuexy theme tree at resources/assets/vendor/... (core SCSS, fonts, and JS libs like Bootstrap, SweetAlert2, Select2, …). You must supply that resources/assets/vendor/ tree yourself (from your Vuexy purchase). Without it, npm run build/dev will fail on missing files.

In short: install this package into a project that already has the Vuexy assets, or add them before building.

📋 Requirements

  • PHP 8.2+
  • Laravel 10–13
  • esanj/managers (installed automatically) — the layout assumes an authenticated manager (manager guard) and uses its permissions for menu visibility and the logout route.
  • Node.js + npm (for the Vite asset build).

📦 Installation

composer require esanj/layout-master
php artisan layout-master:install

The installer asks before overwriting any existing package.json / vite.config.js / postcss.config.js, then publishes everything. Use --force to overwrite without prompts:

php artisan layout-master:install --force

Then build the front‑end:

npm install
npm run dev      # or: npm run build

🗂️ What gets published

Publish tag From (package) To (your app) Contents
esanj-layout-master-views resources/views resources/views layouts/master, sections/*, components/*
esanj-layout-master-menu resources/menu resources/menu admin.json (the menu definition)
esanj-layout-master-assets resources/assets resources/assets css/demo.css, js/*, scss/*
esanj-layout-master-public public public/assets/vendor/layout-master images/logo-esanj.png, images/null.png
esanj-layout-master-static static project root package.json, vite.config.js, postcss.config.js
esanj-layout-master-components Components app/View/Components Menu.php, SubMenu.php

layout-master:install publishes all of these at once. You can also publish a single group:

php artisan vendor:publish --tag=esanj-layout-master-views

⚙️ Using the layout

Make your pages extend layouts.master and fill in the sections:

@extends('layouts.master')

@section('title', 'Dashboard')

@section('vendor-style')
    @vite(['resources/assets/vendor/libs/apex-charts/apex-charts.scss'])
@endsection

@section('page-style')
    @vite(['resources/assets/vendor/scss/pages/dashboard.scss'])
@endsection

@section('content')
    <div class="container">Welcome to the dashboard</div>
@endsection

@section('vendor-script')
    @vite(['resources/assets/vendor/libs/apex-charts/apexcharts.js'])
@endsection

@section('page-script')
    @vite(['resources/assets/js/pages/dashboard.js'])
@endsection

Available sections: title, vendor-style, page-style, content, vendor-script, page-script. The navbar, menu, and footer are included for you.

The page <title> is @yield('title') | {{ trans('app.brand_name') }}, so define brand_name in your app's lang/{locale}/app.php (or change the title in resources/views/layouts/master.blade.php).

🗂️ The menu system

The menu is a JSON file at resources/menu/admin.json with a top‑level menu array:

{
    "menu": [
        {
            "url": "/admin",
            "name": "Dashboard",
            "icon": "menu-icon icon-base ti tabler-smart-home",
            "slug": "admin.dashboard"
        },
        {
            "name": "Managers",
            "icon": "menu-icon icon-base ti tabler-users",
            "slug": "managers",
            "badge": ["primary", "3"],
            "submenu": [
                {
                    "url": "/admin/managers/create",
                    "name": "Create New Manager",
                    "slug": "managers.create",
                    "permission": "managers.create"
                },
                {
                    "url": "/admin/managers",
                    "name": "Managers List",
                    "slug": "managers.index",
                    "permission": "managers.list"
                }
            ]
        }
    ]
}

Item fields:

Field Required Purpose
name yes Label. Passed through __(), so it can be a translation key.
url no Link target (url() is applied). Omit for a parent that only opens a submenu.
icon no Full CSS classes for the icon.
slug no Matched against the current route name to mark the item active.
permission no If set, the item shows only when the manager has this permission (esanj/managers).
target no e.g. "_blank" for external links.
badge no ["color", "text"], e.g. ["primary", "3"].
submenu no Array of child items (nested to any depth).

🔒 The menu requires an authenticated manager. A parent whose children are all hidden by permissions is hidden too.

🧩 Components

After publishing, these components are available in any Blade view:

Component Purpose
<x-menu /> Renders the permission‑filtered main menu.
<x-sub-menu :data="$items" /> Renders a submenu (used internally by <x-menu>).
<x-alert-message :type="'success'" :content="'Saved!'" /> A Bootstrap alert. Types: success/danger/warning/info/primary/secondary/dark.
<x-error field="email" /> Shows validation errors for a field (and field.*).

The master layout also renders a flash alert automatically when you flash a message:

return back()->with('message', ['type' => 'success', 'content' => 'Saved successfully!']);

🎨 Customizing

  • Views/sections: edit the published files in resources/views/ (e.g. sections/navbar.blade.php, layouts/master.blade.php).
  • Logo: replace public/assets/vendor/layout-master/images/logo-esanj.png, or edit the path in sections/navbar.blade.php.
  • Theme defaults (primary color, default theme, RTL, …): resources/assets/js/config.js.
  • Menu: edit resources/menu/admin.json.
  • Build inputs: vite.config.js (auto‑includes resources/assets/js/*, js/pages/*, and the Vuexy vendor/, packages/ trees).

📖 For a complete, beginner‑friendly, step‑by‑step walkthrough — adding a page, wiring a menu item, building assets, and customizing — see docs/GUIDE.md.

🪪 License

MIT © eSanjDev

esanj/layout-master 适用场景与选型建议

esanj/layout-master 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 47 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 esanj/layout-master 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 esanj/layout-master 我们能提供哪些服务?
定制开发 / 二次开发

基于 esanj/layout-master 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 47
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-30