geosem42/filamentor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

geosem42/filamentor

Composer 安装命令:

composer require geosem42/filamentor

包简介

Filamentor - A flexible page builder for Laravel Filament

README 文档

README

Filamentor is a powerful, flexible page builder plugin for Laravel Filament that empowers you to create dynamic pages with a modern drag-and-drop interface. Build professional layouts without writing code using an intuitive grid-based system.

Filamentor Screenshot

Key Features

  • Drag & Drop Interface: Easily create and arrange content with intuitive drag-and-drop interactions
  • Responsive Grid System: Build layouts using a flexible row/column grid that adapts to different screen sizes
  • Ready-to-Use Elements: Includes text, image, and video elements out of the box
  • Margin & Padding Controls: Fine-tune spacing with visual controls for perfect layouts
  • Custom CSS Classes: Apply custom styling to any row or column for unlimited design possibilities
  • Multiple Frontend Options: Works with both Vue/Inertia and Livewire stacks
  • Seamless Filament Integration: Appears as a native feature in your Filament admin panel

Installation

Prerequisites

  • PHP 8.1 or higher
  • Laravel 11.x or higher
  • Filament 3.x
  • Tailwind CSS

CSS Framework Dependency

Filamentor relies on TailwindCSS for its layout system, particularly for:

  • Grid layouts (grid-cols-* classes)
  • Spacing utilities (p-*, m-* classes)
  • Responsive design classes

Make sure your layout includes Tailwind CSS.

Step 1: Install the Package

composer require geosem42/filamentor

Step 2: Run the Installation Command

php artisan filamentor:install

This command will:

  1. Publish migration files to your database/migrations directory
  2. Create necessary public asset directories and copy required files:
    • /public/js/filamentor/filamentor.js
    • /public/css/filamentor/filamentor.css
  3. Prompt you to select your preferred frontend stack (Vue or Livewire)
  4. Publish stack-specific files.

Step 3: Run Migrations

After installing the package, run the migrations:

php artisan migrate

This will create the necessary database tables for pages, layouts, and related entities.

Step 4: Add Route

Add the following route to your routes/web.php:

Route::get('/{slug}', [App\Http\Controllers\PageController::class, 'show'])->name('page.show');

Step 5: Update Tailwind Configuration

To ensure dynamic grid classes work properly, add the following to your tailwind.config.js file:

module.exports = {
    // ...other config
    safelist: [
        'grid-cols-1',
        'grid-cols-2',
        'grid-cols-3',
        'grid-cols-4',
        'grid-cols-5',
        'grid-cols-6',
        'grid-cols-7',
        'grid-cols-8',
        'grid-cols-9',
        'grid-cols-10',
        'grid-cols-11',
        'grid-cols-12'
    ],
    // ...other config
}

Step 6: Register with Filament

Add the Filamentor plugin to your Filament panel provider in app/Providers/Filament/AdminPanelProvider.php:

use Geosem42\Filamentor\FilamentorPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...other configuration
        ->plugins([
            // ...other plugins
            FilamentorPlugin::make(),
        ]);
}

Step 7: Compile Assets (if using Vue)

If you're using the Vue stack, run:

npm run build

Post-installation

After installation, you'll find the Filamentor page builder in your Filament admin panel. You can create and manage pages through the interface.

Template Integration Note

The Filamentor page templates (both Vue and Livewire versions) do not come pre-integrated with any application layout. You will need to manually include them in your own application layout to ensure proper styling, navigation, and site structure.

For example:

  • In Livewire: Wrap resources/views/pages/show.blade.php in your layout.
  • In Vue: Include the resources/js/Pages/Page.vue within your AppLayout layout component.

This design gives you complete flexibility to integrate Filamentor pages within your existing site structure.

Stack-Specific Notes

Vue/Inertia Setup

If you selected the Vue stack, ensure Inertia.js is properly installed and configured in your application. The page rendering happens through the Inertia Page component published during installation.

Livewire Setup

If you selected the Livewire stack, ensure Livewire is properly installed. The page rendering will use the Livewire components published during installation.

For proper SEO functionality with Filamentor's Livewire implementation, your layout must include a @stack('meta') directive in the <head> section.

Published Files

The installation command will publish the following files depending on your selected stack.

For Vue:

  • resources/js/Pages/Page.vue
  • resources/js/Components/Elements/TextElement.vue
  • resources/js/Components/Elements/ImageElement.vue
  • resources/js/Components/Elements/VideoElement.vue
  • app/Http/Controllers/PageController.php

For Livewire:

  • app/Livewire/Page.php
  • app/Livewire/Elements/TextElement.php
  • app/Livewire/Elements/ImageElement.php
  • app/Livewire/Elements/VideoElement.php
  • app/Http/Controllers/PageController.php
  • resources/views/livewire/page.blade.php
  • resources/views/pages/show.blade.php
  • resources/views/livewire/elements/text-element.blade.php
  • resources/views/livewire/elements/image-element.blade.php
  • resources/views/livewire/elements/video-element.blade.php

Troubleshooting

If you encounter issues with the Filamentor UI after installation:

  1. Ensure all frontend assets have been published correctly
  2. Verify that you've added the Tailwind safelist configuration
  3. Make sure you've registered the plugin with your Filament panel
  4. Check that you've run migrations and your database tables are created correctly

License

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

geosem42/filamentor 适用场景与选型建议

geosem42/filamentor 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.02k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2025 年 02 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「geosem42」 「filamentor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 geosem42/filamentor 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 1.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 31
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 31
  • Watchers: 3
  • Forks: 7
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-25