定制 softok2/filament-page-builder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

softok2/filament-page-builder

最新稳定版本:1.0.3

Composer 安装命令:

composer require softok2/filament-page-builder

包简介

This is my package filament-page-builder

README 文档

README

# Filament tool for improve management of pages content speed and easy

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package comes with predefined form components that can be used to build a page:

  • Text
  • ImageUpload
  • TextBox
  • Marquee
  • Slider

Installation

You can install the package via composer:

composer require softok2/filament-page-builder

You can set up all the necessary files by running the following command:

php artisan filament-page-builder:install

And it is ready to use!!

Usage

Its recommended to run migrations and seeders to get the default components and pages.

php artisan migrate --seed

The packages come with a predefined page blocks and layout components in App//Filament//PageBuilder . Page blocks look like this:

class HomeBlock extends PageBlock
{
    const HEADER_SECTION = 'header_section';

    public static string $fileUploadDirectory = 'uploads/pages/';

    public function headerSection(): Block
    {
        return Block::make(self::HEADER_SECTION)->label(__('Header Section'))
            ->schema([
                Text::make('title'),
                ImageUpload::make('background'),
            ])->maxItems(1);
    }
}

Define your own section per page declaring a method with the name and de Section suffix.

Include the plugins in your admin panel:

...
   ->plugins([
        FilamentPageBuilder::make()
])

Customization

Yoy can define your own blocks and components by creating both classes and mapping them in the plugin configuration.

For create a new block you can run the following command:

php artisan filament-page-builder-block:make HistoryBlock

For create a new layout component you can run the following command:

php artisan filament-page-builder-lc:make HeroComponent

Then you can map the new blocks and components in the plugin configuration:

FilamentPageBuilder::make()
            ->withPosts()
            ->blocksMapper([
                'history' => HistoryBlock::class,
            ])
            ->layoutsComponentsMapper([
                'hero' => HeroComponent::class,
            ])

In the example above, 'history' and 'hero' are the name of the page and component respectively. You can easly add them in the seeders:

  • PageSeeder.php
  • LayoutComponentSeeder.php

Testing

composer test

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.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固