bagisto-admin-theme-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAdmin Theme Development
Bagisto后台主题开发
Overview
概述
Admin theme development in Bagisto involves creating custom admin panel themes packaged as Laravel packages. The end result is a self-contained package that can be distributed and maintained independently.
Bagisto中的后台主题开发涉及创建打包为Laravel包的自定义后台面板主题。最终成果是一个可独立分发和维护的自包含包。
When to Apply
适用场景
Activate this skill when:
- Creating custom admin themes as packages
- Building admin theme packages for distribution
- Customizing admin panel styling
- Overriding default admin templates
在以下场景下启用此技能:
- 将自定义后台主题创建为包
- 开发用于分发的后台主题包
- 自定义后台面板样式
- 重写默认后台模板
Bagisto Admin Theme Architecture
Bagisto后台主题架构
Core Components
核心组件
| Component | Purpose | Location |
|---|---|---|
| Theme Configuration | Defines available admin themes | |
| Views Path | Blade template files | Defined in theme config |
| Assets Path | CSS, JS, images | Defined in theme config |
| Admin Service Provider | Loads views and components | |
| 组件 | 用途 | 位置 |
|---|---|---|
| 主题配置 | 定义可用的后台主题 | |
| 视图路径 | Blade模板文件 | 在主题配置中定义 |
| 资源路径 | CSS、JS、图片 | 在主题配置中定义 |
| 后台服务提供者 | 加载视图和组件 | |
Key Configuration Properties
关键配置属性
php
// config/themes.php
'admin-default' => 'default',
'admin' => [
'default' => [
'name' => 'Default',
'assets_path' => 'public/themes/admin/default',
'views_path' => 'resources/admin-themes/default/views',
'vite' => [
'hot_file' => 'admin-default-vite.hot',
'build_directory' => 'themes/admin/default/build',
'package_assets_directory' => 'src/Resources/assets',
],
],
],php
// config/themes.php
'admin-default' => 'default',
'admin' => [
'default' => [
'name' => 'Default',
'assets_path' => 'public/themes/admin/default',
'views_path' => 'resources/admin-themes/default/views',
'vite' => [
'hot_file' => 'admin-default-vite.hot',
'build_directory' => 'themes/admin/default/build',
'package_assets_directory' => 'src/Resources/assets',
],
],
],Reference files — load only what the current task needs
参考文件——仅加载当前任务所需的文件
| File | Load when |
|---|---|
| creating-a-theme.md | Scaffolding the theme package and registering it |
| assets.md | The Vite pipeline, the build, and the dev-server workflow |
| layouts.md | Admin layouts, Blade components, custom layouts |
| reference.md | Package layout, key files, pitfalls, testing |
REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.
| 文件 | 加载时机 |
|---|---|
| creating-a-theme.md | 搭建主题包并完成注册时 |
| assets.md | 处理Vite管道、构建及开发服务器工作流时 |
| layouts.md | 处理后台布局、Blade组件、自定义布局时 |
| reference.md | 处理包布局、关键文件、常见问题、测试时 |
必备子技能: 在完成任何修改前,使用bagisto-change-verification进行验证。