定制 gigabait93/filament-pages 二次开发

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

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

gigabait93/filament-pages

Composer 安装命令:

composer require gigabait93/filament-pages

包简介

Filamen custom pages plugin. Documentation: https://github.com/GIGABAIT93/filament-pages/tree/main/docs

README 文档

README

Latest Version on Packagist Total Downloads

A powerful and flexible page builder plugin for Filament Admin that allows you to create dynamic, multi-language pages with a block-based content system.

Features

  • 🏗️ Block-based Page Builder - Create pages using reusable content blocks
  • 🌍 Multi-language Support - Built-in translation system for international websites
  • 📱 Responsive Design - Mobile-friendly page layouts
  • 🎨 Rich Content Blocks - Text, Images, Gallery, Video, Hero sections, and more
  • 🔧 Customizable Templates - Create and use custom block templates
  • 🧭 Navigation Integration - Automatic navigation menu generation
  • 👁️ Visibility Control - Control page visibility and access
  • 🎯 Position Management - Drag and drop page ordering

Screenshots

FireShot Capture 002 - Edit - StarterKit - gigabait uk FireShot Capture 001 - StarterKit - gigabait uk

Installation

You can install the package via composer:

composer require gigabait93/filament-pages

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-pages-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="filament-pages-config"

Optionally, you can publish the views using:

php artisan vendor:publish --tag="filament-pages-views"

You can publish the language files using:

php artisan vendor:publish --tag="filament-pages-translations"

This is the contents of the published config file:

<?php

return [
    // Group label for pages in the Filament admin navigation. Set to
    // `null` to display pages without a group.
    'admin_navigation_group' => null,

    // Position of the pages group within the admin navigation menu.
    'admin_navigation_order' => 5,

    // Icon for the pages group in the admin navigation menu.
    'admin_navigation_icon' => 'heroicon-o-document-text',


    // Filament panel identifiers that should register the client-side
    // plugin. Uncomment and list your panel IDs below.
    'clients_panels_ids' => [
        // 'client',
    ],

    // The Eloquent model representing application users.
    'user_model' => \App\Models\User::class,
];

Usage

Admin Panel Setup

Register the plugin in your Admin Panel Provider:

use Gigabait93\FilamentPages\AdminPagesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(AdminPagesPlugin::make());
}

Client Panel Setup

Register the plugin in your Client Panel Provider:

use Gigabait93\FilamentPages\ClientPagesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(ClientPagesPlugin::make());
}

Service Provider Registration

Make sure to register the service provider in your config/app.php:

'providers' => [
    // ...
    Gigabait93\FilamentPages\Providers\FilamentPagesServiceProvider::class,
],

Or if you're using Laravel 11's automatic package discovery, this will be handled automatically.

Creating Pages

  1. Navigate to the Pages section in your Filament admin panel

  2. Click "New Page" to create a page

  3. Fill in the basic information:

    • Name: The display name of the page
    • Slug: URL-friendly identifier
    • Template: Choose from available templates
    • Status: Active/Inactive
    • Position: Order in navigation
  4. Add content blocks by clicking "Add Block" and choosing from:

    • Text Block: Rich text content
    • Markdown Text Block: Markdown formatted text
    • Image Block: Single image with caption
    • Gallery Block: Multiple images gallery
    • Video Block: Video embedding
    • Hero Block: Large banner section
    • Button Block: Call-to-action buttons
    • Two Columns Block: Side-by-side content
    • Divider Block: Section separators

Multi-language Support

The plugin supports multi-language pages:

  1. Configure available locales in the config file
  2. Create translations for each page
  3. Content blocks are automatically translatable
  4. Use the language switcher in the admin interface

Available Content Blocks

Text Block

Rich text editor with formatting options:

  • Rich text content
  • Typography controls
  • Link management
  • List formatting

Image Block

Single image with options:

  • Image upload
  • Alt text for SEO
  • Caption text
  • Image sizing options

Gallery Block

Multiple image showcase:

  • Multiple image upload
  • Image ordering
  • Lightbox functionality
  • Grid layout options

Video Block

Video embedding:

  • YouTube/Vimeo URLs
  • Local video upload
  • Autoplay options
  • Responsive sizing

Hero Block

Large banner sections:

  • Background image/video
  • Overlay text
  • Call-to-action buttons
  • Alignment options

Button Block

Call-to-action elements:

  • Button text and URL
  • Style variants
  • Icon support
  • Target options

Custom Templates

You can create custom block templates:

  1. Publish the views: php artisan vendor:publish --tag="filament-pages-views"
  2. Create new template directories in resources/views/vendor/pages/blocks/
  3. Add your custom Blade templates
  4. Templates will be automatically discovered

Example custom template structure:

resources/views/vendor/pages/blocks/
├── custom-template/
│   ├── text.blade.php
│   ├── image.blade.php
│   └── gallery.blade.php

Helper Functions

The plugin provides several helper functions:

page_normalize_blocks()

Normalizes block content array:

$blocks = page_normalize_blocks($page->content);

page_media_url()

Generates media URLs:

$url = page_media_url($imagePath, 'public');

templatesOptions()

Gets available templates:

$templates = templatesOptions();

iconsOptions()

Gets available Heroicons:

$icons = iconsOptions();

Frontend Display

To display pages on the frontend, the plugin automatically registers routes. You can also manually create routes:

use Gigabait93\FilamentPages\Pages\Show;

Route::get('/p/{slug?}', Show::class)->name('pages.show');

Customizing Views

Publish and customize the views:

php artisan vendor:publish --tag="filament-pages-views"

The main page view is located at:

resources/views/vendor/pages/show.blade.php

Block templates are located at:

resources/views/vendor/pages/blocks/

Navigation Integration

Pages are automatically added to navigation menus. You can control this behavior:

  1. Set navigation group in page settings
  2. Choose navigation icon
  3. Set navigation position
  4. Enable/disable navigation visibility

Credits

License

The MIT License (MIT). Please see License File for more information.

Filament Plugin Directory

This plugin is listed in the Filament Plugin Directory.

gigabait93/filament-pages 适用场景与选型建议

gigabait93/filament-pages 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 gigabait93/filament-pages 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gigabait93/filament-pages 我们能提供哪些服务?
定制开发 / 二次开发

基于 gigabait93/filament-pages 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-21