承接 rolland97/filament-resource-customizer 相关项目开发

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

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

rolland97/filament-resource-customizer

最新稳定版本:v1.1.0

Composer 安装命令:

composer require rolland97/filament-resource-customizer

包简介

Customize Filament resources with optional Filament Shield permissions scaffolding.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Customize Filament resources with optional Filament Shield permissions scaffolding.

What it does

  • Splits a Filament resource table into dedicated column, filter, and action classes.
  • Generates a permissions class per resource (optional).
  • Builds or updates Filament Shield resources.manage entries.

Requirements

  • PHP 8.3+ | 8.4+
  • Laravel 12
  • Filament 4 or 5

This package is recommended alongside Filament Shield for generating resources.manage entries, but it also works without Filament Shield. You can disable permission class generation by setting permissions.enabled to false in the config.

Installation

composer require rolland97/filament-resource-customizer --dev

Publish the config:

php artisan vendor:publish --tag="filament-resource-customizer-config"

Publish stubs (optional):

php artisan vendor:publish --tag="filament-resource-customizer-stubs"

Quick Start

  1. Customize a resource:
php artisan filament:customize-resource DepartmentResource

(DepartmentResource is just an example — replace it with your actual resource class.)

  1. Or run everything at once:
php artisan filament:customize-resource-all DepartmentResource

Usage

Customize a resource by splitting tables/filters/actions into separate classes:

php artisan filament:customize-resource DepartmentResource

Target a specific panel:

php artisan filament:customize-resource DepartmentResource --panel=Admin

Generate a permissions class for a resource:

php artisan filament:make-resource-permissions DepartmentResource

Generate Filament Shield resources configuration:

php artisan filament:shield-config

Generate for a specific panel:

php artisan filament:shield-config --panel=Admin

Merge with existing resources:

php artisan filament:shield-config --merge

Run all steps (customize, permissions, and Shield config) in one command:

php artisan filament:customize-resource-all DepartmentResource

Run all steps for a specific panel:

php artisan filament:customize-resource-all DepartmentResource --panel=Admin

If resources, resources.manage, resources.subject, or resources.exclude are missing, the command will create them.

Commands

Command Description
filament:customize-resource Generate table, column, filter, and action classes
filament:make-resource-permissions Generate only the permissions class
filament:shield-config Update Filament Shield resources.manage
filament:customize-resource-all Run customize + permissions + Shield config

Configuration

Key options in config/filament-resource-customizer.php:

  • resources_path: Where Filament resources live; accepts a string or array (default: app/Filament/Resources)
  • stubs_path: Custom stub directory (default: stubs/filament-resource-customizer)
  • panels.auto_detect: Auto-detect Filament panel resource paths under app/Filament/*/Resources (default: true)
  • permissions.enabled: Toggle permissions generation
  • permissions.placement: resource, parent, or custom
  • permissions.custom_path: Target path if placement is custom
  • permissions.namespace: Override permissions namespace
  • shield.default_methods: Default methods when no permissions class exists
  • shield.static_resources: Always include these resources in manage
  • shield.merge: Default merge behavior for filament:shield-config

Filament Shield integration

If you use Filament Shield, the filament:shield-config command will update resources.manage. By default it replaces entries unless you:

  • pass --merge, or
  • set shield.merge to true in the config.

Multi-panel setups

You can use any combination of these:

  • --panel=Admin to target a single panel for a command.
  • resources_path as an array, e.g. ['app/Filament/Resources', 'app/Filament/Admin/Resources'].
  • panels.auto_detect=true to auto-add app/Filament/*/Resources alongside the configured paths.

Example Structure

Running the customize command for a resource will generate classes like these:

app/Filament/Resources/Department/Departments/
├── DepartmentResource.php
├── DepartmentPermissions.php
└── Tables/
    ├── DepartmentsTable.php
    ├── DepartmentsColumn.php
    ├── DepartmentsFilter.php
    ├── DepartmentsRecordAction.php
    └── DepartmentsToolbarAction.php

Testing

composer test

Changelog

Please see CHANGELOG for more information.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固