creode/nova-page-builder
Composer 安装命令:
composer require creode/nova-page-builder
包简介
Exposes a simple customisable page builder in Laravel Nova, built on top of Flexible Content fields.
README 文档
README
Exposes a simple customisable page builder in Laravel Nova, built on top of Flexible Content fields.
Installation
You can install the package via composer:
composer require creode/nova-page-builder
Optionally, you can publish the views using
php artisan vendor:publish --tag="nova-page-builder-views"
Usage
This package is split from a previous module titled nova-pages. That module exposed page builder functionality where new components could be created easily. This module splits the page builder functionality from the page management functionality, allowing you to use the page builder without the page management.
This module heavily utilises the nova-flexible-content package, and as such, you should familiarise yourself with that package before using this one.
Page Builder Field
This module creates a new field type, Creode\NovaPageBuilder\Nova\Fields\PageBuilder. This field type is a wrapper around the Flexible field type, and as such, you can use all of the same methods as you would with the Flexible field type. The only difference is that the PageBuilder field type will automatically register all of the components that you have created.
Excluding Components
If you wish to exclude certain components from being used within the field, you can do so by passing an array of component names to the exclude method on the PageBuilder field type. For example, if you wish to exclude the Banner component, you can do so by adding the following to your Page Nova resource:
public function fields(Request $request) { return [ // ... PageBuilder::make('Content') ->exclude(['banner']), ]; }
Rendering Components
This module exposes a blade file that can be used to render the components on the front-end of your site.
We also include a trait that needs to be added to your model. This trait will allow you to access the content of the page builder field and allow you to pass the components to the blade file. The trait is Creode\NovaPageBuilder\Traits\HasPageBuilderContent. You can use this trait in your model like so:
use Creode\NovaPageBuilder\Traits\HasComponents; class Page extends Model { use HasPageBuilderContent; /** * The name of your page builder field. */ protected $componentField = 'content'; }
Once the above has been added to your model you can render the components of the page builder field by calling $page->components and passing this to the view file below:
For example:
@include('page-builder::components', ['components' => $page->components])
Extension
As previously stated, this module will not define any format of page content. However it does contain the infrastructure for defining content blocks with minimal code. To define a new content block you will need to define an extension of the Creode\NovaPageBuilder\Abstracts\PageBlockAbstract class. Your new class should then be instantiated within the boot method of a service provider.
As part of your new class, you must define a "$label" string property. This will be the human readable representation of your new content block. You must define a "$name" string property. This will be how Laravel will reference your content block. You must define a "$view" string property. This should reference a view file containing markup and/or template logic for rendering your block on front-end pages. You must define a "fields" method. This should return an array of Laravel Nova field objects.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
creode/nova-page-builder 适用场景与选型建议
creode/nova-page-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 79 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「creode」 「nova-page-builder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 creode/nova-page-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 creode/nova-page-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 creode/nova-page-builder 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Base module for handling taxonomy within Laravel.
Takes the existing Laravel Assets module and adds functionality to make it work in Nova.
Creates a new folder taxonomy for Laravel projects.
Base module which is used for the DAM to create assets.
Allows the folders module to be used with Laravel Nova.
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-24