rolland97/filament-resource-customizer

Customize Filament resources with optional Filament Shield permissions scaffolding.

Maintainers

Package info

github.com/rolland97/filament-resource-customizer

pkg:composer/rolland97/filament-resource-customizer

Fund package maintenance!

Rolland97

Statistics

Installs: 156

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 2

v1.1.0 2026-01-27 08:15 UTC

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.