syriable/filament-utilities
Composer 安装命令:
composer require syriable/filament-utilities
包简介
Developer tooling for the Syriable Filament ecosystem — translatable resource generators and modular plugin scaffolding.
README 文档
README
Developer tooling for the Syriable Filament ecosystem. The package wires custom Artisan generators that scaffold translatable Filament resources and module plugins, a guard-aware Filament Shield role resource, and a panel plugin that bundles Syriable's translator, activity log, and Shield integrations.
Features
syriable:make-resource— drop-in replacement for Filament's resource generator that extendsTranslatableResourceand 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(CreatePluginCommand) — scaffolds a Filament panel plugin for an InterNACHI/modular module, auto-discovers its Filament components, and registers the plugin in the module service provider.- Custom file generators — binds Syriable generators into Filament's
make:filament-resourcepipeline so generated code is translation-ready out of the box. UtilitiesPlugin— registersTranslatorPlugin,Activitylog, andFilamentShieldPluginon a panel from a single entry point.- Guard-aware
RoleResource— extends Filament Shield's role resource with a liveguard_nameselector, per-guard permission matrices, and correct user counts across morph types.
Requirements
- PHP 8.4+
- Laravel 12 or 13
- Filament 5.5+
bezhansalleh/filament-shield^4.2syriable/filament-translator^1.1syriable/filament-activitylog^0.1
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
UtilitiesServiceProvider is auto-discovered. Register UtilitiesPlugin on every Filament panel that should use the bundled Syriable integrations:
use Filament\Panel; use Syriable\Filament\Plugins\Utilities\UtilitiesPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ UtilitiesPlugin::make(), ]); }
UtilitiesPlugin registers the custom RoleResource, TranslatorPlugin, Activitylog, and FilamentShieldPlugin. You do not need to register those plugins separately when using UtilitiesPlugin.
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.
plugin:resource (CreatePluginCommand)
Scaffold a Filament panel plugin inside an InterNACHI/modular module:
php artisan plugin:resource users
| Argument | Required | Description |
|---|---|---|
plugin |
No | Module directory name (for example, users). When omitted, the command interactively suggests directories from your configured modules path. |
The command reads config('app-modules.modules_directory') (default modules) and config('app-modules.modules_namespace') (default Modules) to resolve paths and namespaces.
What it generates
For php artisan plugin:resource users, the command creates:
modules/users/src/UsersPlugin.php
with namespace Modules\Users. The generated plugin class:
- implements Filament's
Plugincontract, - uses the module slug as its plugin ID (
users), - discovers resources, pages, and widgets under
Filament/Resources,Filament/Pages, andFilament/Widgetsrelative to the plugin file.
Service provider registration
CreatePluginCommand also patches the module service provider at modules/{module}/src/Providers/{Module}ServiceProvider.php:
- adds the plugin
useimport when missing, - appends
$panel->plugin(UsersPlugin::make())to an existingPanel::configureUsing()block, or - creates a new
Panel::configureUsing()block insideregister()when none exists.
Re-running the command is safe — it skips registration when the plugin is already present.
Customize the generated plugin by publishing the stub before running the command (see Publish generator stubs).
Guard-aware role management
The package replaces Filament Shield's default RoleResource with a translatable variant that supports multiple authentication guards.
When creating or editing a role, the guard_name field is populated from config('auth.guards') and updates the permission matrix live. Changing the guard:
- swaps Filament Shield's
resources.excludeandpolicies.methodsconfig for guard-specific overrides fromconfig/filament-utilities.php, - flushes Shield's cached resource discovery so the permission checkboxes reflect the selected guard,
- prunes stale checkbox state so validation does not fail when switching between guards.
The roles table counts users via the model_has_roles pivot directly, so users_count is accurate when the same role is assigned to models on different guards (for example, Admin and Buyer).
Publish and customize the web-guard overrides:
php artisan vendor:publish --tag=filament-utilities-config
use Modules\Users\Filament\Resources\Admins\AdminResource; use Syriable\Filament\Plugins\Utilities\Filament\Resources\Roles\RoleResource; return [ 'shield' => [ 'resources' => [ // Resources hidden from the permission matrix for the 'web' guard. 'exclude' => [ RoleResource::class, AdminResource::class, ], ], 'policies' => [ // Policy methods available in the permission matrix for the 'web' guard. 'methods' => ['viewAny', 'view', 'create', 'update'], ], ], // ... ];
Non-web guards use your application's config/filament-shield.php values. Run php artisan shield:generate as usual to scaffold permissions and policies for application resources.
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.
Configuration
Publish the config file to customize translator path aliases, missing-key scaffolding, and Shield guard overrides:
php artisan vendor:publish --tag=filament-utilities-config
This copies config/filament-utilities.php to your application's config/ directory:
return [ 'shield' => [ 'resources' => [ 'exclude' => [ // Resource classes omitted from the 'web' guard permission matrix. ], ], 'policies' => [ 'methods' => ['viewAny', 'view', 'create', 'update'], ], ], 'translator' => [ // Scaffold missing translation keys while resolving labels. 'create_missing_translation_keys' => true, // Map namespaces to translation path aliases. 'path_aliases' => [ 'App\\Livewire' => 'livewire', 'Modules\\Users\\Filament\\Resources' => 'modules/users', ], ], ];
UtilitiesPlugin reads these values when registering TranslatorPlugin, Activitylog, FilamentShieldPlugin, and the bundled RoleResource.
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,
TextInputcapped at 255 characters and trimmed,- trimmed
Textarea, - consistent modal alignment/width for actions,
- a single-column responsive
Schemadefault, - when
codewithdennis/filament-advanced-componentsis installed,AdvancedTextColumnvalues become clickablemailto:/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'sfilament-utilities::filament.components.textareafield 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
AdvancedTextColumnintegration requires the optional, paidcodewithdennis/filament-advanced-componentspackage. It is guarded byclass_exists(), so the rest of the defaults work without it.
Testing
composer test
Other useful scripts:
composer analyse # PHPStan (512M memory limit) composer lint # Laravel Pint
Run composer analyse instead of invoking PHPStan directly — the package analysis exceeds PHP's default 128M memory limit.
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.
syriable/filament-utilities 适用场景与选型建议
syriable/filament-utilities 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「filament」 「filament-plugin」 「filamentphp」 「syriable」 「filament-utilities」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 syriable/filament-utilities 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 syriable/filament-utilities 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 syriable/filament-utilities 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
jitone-ai is a powerful FilamentPHP plugin that integrates AI-powered features directly into your Filament forms.
Send Notification to discord channel Webhook using native FilamentPHP Notification Facade class
Alfabank REST API integration
Database-driven onboarding for Filament: progress checklists and guided spotlight tours, translatable to any locale.
Laravel package for Accurate Online API integration.
Create-project starter for a Laravel application with the public Capell CMS foundation.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-07