承接 afea/filament-cms-core 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

afea/filament-cms-core

最新稳定版本:v0.1.0

Composer 安装命令:

composer require afea/filament-cms-core

包简介

Shared infrastructure for the Afea Filament CMS package ecosystem: SEO metadata, polymorphic forms, routing strategy, Filament plugin base.

README 文档

README

Shared infrastructure for the Afea Filament CMS package ecosystem.

Everything a modular CMS needs, without the modules themselves:

  • SeoMetadata model + HasSeo / InteractsWithSeoForm traits + reusable Filament SeoSchema
  • Polymorphic forms: Form, FormQuestion, FormQuestionOption, FormSubmission, FormSubmissionAnswer + HasForms trait + attachable via the formables pivot
  • RoutingStrategy enum (slug / resource / localized) + RouteRegistrar
  • BaseCmsPlugin abstract class every first-party module extends
  • Laravel Prompts-backed afea:install:core command

Installation

composer require afea/filament-cms-core
php artisan afea:install:core

The installer publishes config/afea-cms.php, publishes translations under lang/vendor/afea-cms, and runs the core migrations.

Configuration keys

return [
    'panel' => 'admin',
    'models' => [
        'seo_metadata' => \Afea\Cms\Core\Models\SeoMetadata::class,
        'form' => \Afea\Cms\Core\Models\Form::class,
        // ...
    ],
    'media' => [
        'disk' => env('AFEA_CMS_MEDIA_DISK', 'public'),
        'private_disk' => env('AFEA_CMS_PRIVATE_DISK', 'local'),
    ],
    'seo' => [
        'sitemap_cache_key' => 'sitemap:urls',
    ],
    'forms' => [
        'submissions_disk' => env('AFEA_CMS_SUBMISSIONS_DISK', 'local'),
        'temporary_url_ttl_minutes' => 60,
    ],
];

Model override

Extend any shipped model and bind the subclass in configuration:

// app/Models/SeoMetadata.php
namespace App\Models;

class SeoMetadata extends \Afea\Cms\Core\Models\SeoMetadata
{
    public function scopeIndexable($query)
    {
        return $query->where('noindex', false);
    }
}
// config/afea-cms.php
'models' => [
    'seo_metadata' => \App\Models\SeoMetadata::class,
],

Every internal relation resolves the class from config, so relationships keep working across the package ecosystem.

Common scenarios

Add SEO to a model

use Afea\Cms\Core\Concerns\HasSeo;

class Page extends Model
{
    use HasSeo;
}

On the Filament EditPage:

use Afea\Cms\Core\Concerns\InteractsWithSeoForm;
use Afea\Cms\Core\Filament\Schemas\SeoSchema;

class EditPage extends EditRecord
{
    use InteractsWithSeoForm;

    protected function getFormSchema(): array
    {
        return [
            // ...model fields
            Tabs\Tab::make('SEO')->schema(SeoSchema::make()),
        ];
    }
}

Attach a CMS-defined form to a content model

use Afea\Cms\Core\Concerns\HasForms;

class CustomPage extends Model
{
    use HasForms;
}

$page = CustomPage::first();
$page->attachForm($contactForm);
$page->forms; // Collection<Form>

Register a public-facing route using the configured strategy

use Afea\Cms\Core\Enums\RoutingStrategy;
use Afea\Cms\Core\Routing\RouteRegistrar;

RouteRegistrar::register(
    strategy: RoutingStrategy::from(config('afea-blog.routing_strategy', 'resource')),
    prefix: 'blog',
    slugHandler: [BlogController::class, 'show'],
    indexHandler: [BlogController::class, 'index'],
);

Testing

From the monorepo root:

./vendor/bin/pest --group=core

Or within the package:

composer install
./vendor/bin/pest

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固