manialab/maniaprintlab
Composer 安装命令:
composer require manialab/maniaprintlab
包简介
Provides three Nova resources for managing badge configurations, badge detail settings, and print history
README 文档
README
ManiaPrintLab is a drop-in Laravel Nova package that provides:
- Badge Details resource to define layout settings for all badge elements
- Printing Records resource with shortcode generation and one-click print buttons
- Print Badges menu tool that loads your legacy print page via an external route
- Publishable migrations for the
maniaprintlab_configurations,badges_details, andprintingtables
Requirements
- PHP ^8.0
- Laravel Nova ^4.0
Installation
# 1. Pull in the stable release composer require manialab/maniaprintlab:^1.0 # 2. Publish the migrations php artisan vendor:publish --tag=maniaprintlab-migrations # 3. Run the migrations (creates configurations, badges_details, and printing tables) php artisan migrate # 4. Link storage for file uploads php artisan storage:link # 5. Clear & rebuild caches (optional but recommended) php artisan optimize:clear
Manual Integration (if using a custom Nova menu)
If you maintain your own NovaServiceProvider with a custom mainMenu, add:
// app/Providers/NovaServiceProvider.php use ManiaLab\ManiaPrintLab\Nova\BadgeDetail; use ManiaLab\ManiaPrintLab\Nova\PrintingRecord; use Laravel\Nova\Menu\MenuSection; use Laravel\Nova\Menu\MenuItem; Nova::mainMenu(function () { return [ // … existing sections … MenuSection::make(('PrintLab'), [ MenuItem::resource(BadgeDetail::class)->name(('Badge Details')), MenuItem::resource(PrintingRecord::class)->name(('Print Records')), ])->icon('printer')->collapsable(), ]; });
Usage
-
Open Nova You will see a PrintLab section with:
- Badge Details: define field positions, sizes, and display flags
- Printing Records: view history, copy a
[maniaprint ...]shortcode, or click Print - Print Badges menu tool: opens your legacy
index.phpprint page
-
Create a Configuration profile, then add one or more Badge Details entries.
-
Generate or import Printing Records. On the index:
- Shortcode column: copy and embed the badge link elsewhere
- Print column: click the button to open the print page in a new tab
Adding Print Button to Visitor Nova Resource
To add a Print button to your custom Visitor Nova resource, edit app/Nova/Visitor.php:
-
Import the
Textfield at the top:use Laravel\Nova\Fields\Text;
-
Append the Print button to
fields():Text::make('Print', function () { $url = route('maniaprintlab.print', [ $this->token_key,w $this->id, ]); return "<a href=\"{$url}\" target=\"_blank\" class=\"btn btn-primary btn-sm\">Print</a>"; }) ->onlyOnIndex() ->asHtml() ->help('Click to open the badge print page in a new tab.'),
-
Clear & rebuild caches:
php artisan optimize:clear
Contributing
Pull requests welcome! Please adhere to PSR-12 standards and add tests for new features.
License
This package is open-source under the MIT License.
manialab/maniaprintlab 适用场景与选型建议
manialab/maniaprintlab 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 manialab/maniaprintlab 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 manialab/maniaprintlab 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-28