承接 syriable/filament-utilities 相关项目开发

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

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

syriable/filament-utilities

最新稳定版本:0.1.2

Composer 安装命令:

composer require syriable/filament-utilities

包简介

Developer tooling for the Syriable Filament ecosystem — translatable resource generators and modular plugin scaffolding.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Software License

Developer tooling for the Syriable Filament ecosystem. The package wires custom Artisan generators that scaffold translatable Filament resources and module plugins, built on top of syriable/filament-translator.

Features

  • syriable:make-resource — drop-in replacement for Filament's resource generator that extends TranslatableResource and translatable resource pages instead of Filament's base classes.
  • Module-aware model discovery — interactive model selection searches Eloquent models under your modules/ directory.
  • plugin:resource — scaffolds a Filament panel plugin for an InterNACHI/modular module and registers it in the module service provider.
  • Custom file generators — binds Syriable generators into Filament's make:filament-resource pipeline so generated code is translation-ready out of the box.

Requirements

For plugin:resource, your application must use InterNACHI/modular with modules under the path configured in config/app-modules.php.

Installation

Install the package via Composer:

composer require syriable/filament-utilities

Register TranslatorPlugin on every Filament panel that should resolve convention-based labels:

use Filament\Panel;
use Syriable\Filament\Plugins\Translator\TranslatorPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            TranslatorPlugin::make(),
        ]);
}

UtilitiesServiceProvider is auto-discovered. No panel plugin registration is required for the generators to work.

Usage

Generate a translatable resource

Use syriable:make-resource (alias: syriable:resource) instead of make:filament-resource. It accepts the same options as Filament's command — panel selection, soft deletes, separate form/table schema classes, and so on.

php artisan syriable:make-resource Buyer --panel=dashboard

When no model argument is passed, the command interactively suggests Eloquent models discovered from classes loaded from your modules/ directory.

Generated classes extend Syriable's translatable bases:

Generated class Extends
Resource TranslatableResource
Create page TranslatableCreateRecord
Edit page TranslatableEditRecord
List page TranslatableListRecords

Model namespaces are resolved relative to the selected resource namespace so module resources reference module models instead of App\Models.

After generation, add translation keys under lang/{locale}/ following the filament-translator convention. Enable createMissingTranslationKeys() during local development to scaffold missing keys automatically.

Generate a module Filament plugin

Scaffold a Filament plugin class inside a modular application:

php artisan plugin:resource users

When the module name is omitted, the command interactively lists directories under modules/.

The command:

  1. Creates {Module}Plugin.php in modules/{module}/src/ using the published stub.
  2. Registers the plugin on the module's service provider via Panel::configureUsing().

The generated plugin discovers resources, pages, and widgets under the module's Filament/ directories.

Publish generator stubs

Customize the plugin stub before running plugin:resource:

php artisan vendor:publish --tag=filament-utilities-stubs

Stubs are copied to stubs/filament-utilities/ in your application root.

Opinionated Filament defaults and macros

The package ships several opt-in helpers. They are not applied automatically — call them from your own service provider's boot() method:

use Syriable\Filament\Plugins\Utilities\UtilitiesServiceProvider;

public function boot(): void
{
    UtilitiesServiceProvider::initializeFilamentComponents();
    UtilitiesServiceProvider::microFilamentComponents();
    UtilitiesServiceProvider::configureFactoryIcons();
    UtilitiesServiceProvider::configureActivitylogTimeline();
}

initializeFilamentComponents() applies global defaults via configureUsing():

  • end-aligned form actions on pages,
  • TextInput capped at 255 characters and trimmed,
  • trimmed Textarea,
  • consistent modal alignment/width for actions,
  • a single-column responsive Schema default,
  • when codewithdennis/filament-advanced-components is installed, AdvancedTextColumn values become clickable mailto: / tel: / https://wa.me/ links.

microFilamentComponents() registers convenience macros:

  • ToggleButtons::fullWidth(),
  • Section::prime() (a rounded, bordered container),
  • Textarea::counter() — renders a live character counter using this package's filament-utilities::filament.components.textarea field wrapper.

configureFactoryIcons() registers your application's resources/svg/icons directory as a Blade Icons set (fluxwork, prefix flux).

configureActivitylogTimeline() applies compact defaults and a per-event icon map to syriable/filament-activitylog's ActivitylogTimeline component.

The AdvancedTextColumn integration requires the optional, paid codewithdennis/filament-advanced-components package. It is guarded by class_exists(), so the rest of the defaults work without it.

Testing

composer test

Other useful scripts:

composer analyse   # PHPStan
composer lint      # Laravel Pint

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固