- What is tomatophp/filament-helpers used for?
- It is a Laravel package that adds an Artisan generator for reusable Filament helper classes. You can scaffold form, table, action, and filter classes so resource files stay smaller and CRUD setup is faster. It is aimed at Filament apps that want less repetitive form and table code.
- How do I install tomatophp/filament-helpers?
- Install it with Composer by running composer require tomatophp/filament-helpers in your Laravel project. The package is MIT licensed, so legal adoption risk is low. After installation, use the php artisan filament:helpers command to start generating helper classes.
- Which Laravel and Filament versions does filament-helpers support?
- The package is built for Laravel applications using Filament v2 or later; Filament v1 is not a fit. The technical assessment lists PHP 8.0+ and Laravel 8, 9, or 10 as implied compatibility through Filament v2. Check the Composer constraints and test against your exact Filament patch version before upgrading.
- How do I generate a helper class with filament:helpers?
- Run php artisan filament:helpers and choose the helper type and class name when prompted. The command can generate the class inside a module or a selected path inside your resource. This CLI-driven workflow reduces manual setup but assumes you are comfortable with Artisan.
- How do I use a generated form helper in a Filament resource?
- Import the generated form class, for example App\Filament\Resources\AccountResource\Forms\UserForm, and return UserForm::make($form) from your resource form method. The generated class encapsulates the form schema so the resource stays focused. You can apply the same pattern to table helpers with UserTable::make($table).
- Can filament-helpers generate table actions and filters?
- Yes. The README shows generated action and filter helper classes used with $table->actions(UserActions::make()) and $table->filters(UserFilters::make()). This lets you keep action and filter definitions in reusable classes instead of inline table configuration. It fits read-heavy or standard CRUD tables especially well.
- Does filament-helpers work with modular Laravel apps?
- The generator supports generating classes inside a module or a selected path inside your resource. That makes it a reasonable fit for modular Laravel architectures such as Spatie Laravel Modules. You still need to verify namespace collisions and ensure generated classes do not clash with existing Filament classes.
- What are the limitations of filament-helpers?
- Generated classes may enforce rigid patterns, so complex forms with multi-step workflows or conditional state management may still need hand-written overrides. The package is tightly coupled to Filament Form and Table internals, so Filament API changes can break generated code. It also assumes your database tables and resources already exist.
- Is filament-helpers suitable for production use?
- It can be used in production for simple to medium CRUD resources, especially internal tools where developer velocity matters. The assessment recommends piloting it on non-critical resources and auditing generated code before wider adoption. For highly customized Filament apps, keep critical sections hand-written and treat the generator as boilerplate assistance.
- What alternatives exist to filament-helpers?
- Filament's own scaffolding and custom macros can reduce boilerplate without adding a dependency. Hand-written reusable form, table, action, and filter classes are another option with more control. filament-helpers is most compelling when you want a CLI generator that supports modular paths and repeated CRUD patterns.