hemant17/pagewire
Composer 安装命令:
composer require hemant17/pagewire
包简介
Livewire 4 page builder with Mary UI for Laravel 12.
README 文档
README
Pagewire
Livewire 4 page builder package for Laravel 12 using Mary UI components. Inspired by existing implementation with reusable/global sections.
Installation
composer require hemant/pagewire php artisan pagewire:install php artisan vendor:publish --tag=pagewire-config --tag=pagewire-migrations --tag=pagewire-views php artisan migrate
Routes
- Admin index:
admin/pages(name:admin.pages.index) - Builder:
admin/pages/builder/{slug?}(name:admin.pages.builder) - Menu manager:
admin/menus(name:admin.menus.manager) - Public page:
/{public_prefix}/{slug}(default:/pages/{slug}) (name:dynamic.page)
You can change prefix/middleware via config/pagewire.php.
Home page (optional)
If you want Pagewire to render a "home" page at /, enable:
'home' => [ 'register_route' => true, ],
Pagewire will render the page marked is_home = true (if the column exists), otherwise it will fall back to the slug configured by pagewire.home.fallback_slug (default: home).
Layout
Set layout in config/pagewire.php (e.g., 'layout' => 'layouts.app') to force the Livewire pages to use a specific Blade layout. Leave it null to let the caller/default layout apply.
Sections
Builder lists templates by scanning config('pagewire.sections_paths') (defaults include resources/views/sections/*.blade.php). Provide matching section editor partials at resources/views/livewire/admin/page/section-editors/{section}.blade.php (or rely on the package defaults like the hero-area example).
Quick scaffolding:
php artisan pagewire:make-section hero-area
This creates:
- Front-end section:
resources/views/sections/hero-area.blade.php - Builder editor override (namespaced):
resources/views/livewire/pagewire/section-editors/hero-area.blade.php - Defaults + repeater stubs:
resources/pagewire/sections/hero-area.php
Defaults and repeaters
To avoid editing vendor code, put per-section defaults and repeater item stubs in resources/pagewire/sections/{section}.php:
return [ 'defaults' => ['title' => '...', 'description' => '...'], 'repeaters' => [ 'items' => ['title' => '', 'description' => ''], 'team_members.social_links' => ['platform' => '', 'url' => ''], ], ];
The builder reads these files automatically via config('pagewire.definitions_path').
In editor blades, use the generic methods:
wire:click="repeaterAdd({{ $index }}, 'items')" wire:click="repeaterRemove({{ $index }}, 'items', {{ $itemIndex }})" wire:click="repeaterAddNested({{ $index }}, 'team_members', {{ $memberIndex }}, 'social_links')" wire:click="repeaterRemoveNested({{ $index }}, 'team_members', {{ $memberIndex }}, 'social_links', {{ $linkIndex }})"
File uploads
Pagewire ships an anonymous Blade component you can use in your editor partials:
<x-pagewire::file-upload label="Background Image" accept="image/*" :aspectRatio="null" wire:model.live="pageContents.{{ $index }}.content.background_image" />
Component view: resources/views/components/file-upload.blade.php.
Dependencies
- Laravel ^12
- Livewire ^4
- Mary UI
- spatie/livewire-filepond
Authorization
This package does not ship Gate/Policy checks. Protect the admin routes using your app middleware/authorization as needed.
Models
The package ships Page, PageContent, and GlobalSection models plus migrations. admin_id, created_by, and updated_by reference your default user provider; override via PAGEWIRE_USER_MODEL env/config if needed.
Livewire components
pagewire.admin.page.index– list, search, filter, duplicate, publish toggle, delete.pagewire.admin.page.builder– drag/drop sections, global reuse/override, publish/draft, file uploads.
Rendering public pages
The included pagewire::page view loops the stored sections and includes sections.{section_name}. Provide your front-end section blades there.
Editor assets (Quill, Cropper, etc.)
By default, Pagewire can load editor-related assets from CDNs on the builder page. Configure in config/pagewire.php:
pagewire.cdn_assets.enabled(setfalseif your app bundles these)pagewire.cdn_assets.styles/pagewire.cdn_assets.scripts
Menu manager
Configure locations in config/pagewire.php:
'menu' => [ 'locations' => [ 'header' => 'Header', 'footer' => 'Footer', ], ]
Then visit admin/menus to create menus, assign them to locations, and build nested menu items (drag-sort within each level; indent/outdent via buttons).
hemant17/pagewire 适用场景与选型建议
hemant17/pagewire 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hemant17/pagewire 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hemant17/pagewire 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-22