- How do I install tomatophp/filament-types in a Laravel app?
- Install it with composer require tomatophp/filament-types, then run php artisan filament-types:install. Register FilamentTypesPlugin::make() in your AdminPanelProvider after installation. The package is built for FilamentPHP v3.x, so confirm that version before installing.
- Does tomatophp/filament-types work with Laravel and FilamentPHP v4?
- It is purpose-built for FilamentPHP v3.x and uses Eloquent plus Filament resource architecture. MySQL, PostgreSQL, and SQLite compatibility are supported. Filament v4 compatibility is not assured, so pin Filament to 3.x unless you have verified a compatible release or fork.
- How do I configure types, groups, icons, and colors in the Filament panel?
- In AdminPanelProvider, add the plugin with FilamentTypesPlugin::make() and chain the types method. Define TypeFor::make('posts') with TypeOf::make('categories'), then register entries such as Type::make('news')->name('News')->icon(...)->color(...). This fluent API controls labels, grouping, icons, and colors from code.
- What kind of data can I manage with this package?
- It supports dynamic database-backed types including Json, Array, Boolean, Enum, and polymorphic relations. It is suited to CMS plugins, multi-tenant configuration, and extensible data models where fixed Eloquent relationships are too rigid. Type administration is handled through a Filament resource.
- Is it safe to upgrade tomatophp/filament-types from v4.0.2 to v5.0.1?
- Treat v5.0.1 as a major upgrade even though the published notes focus on the BaseTypePage seeding fix. A major version bump can include breaking changes not listed, so diff the package and review the changelog before upgrading. Run a green staging deployment and plan data cleanup in the same window.
- What was the BaseTypePage seeding bug fixed in v5.0.1?
- Before v5.0.1, BaseTypePage seeded records returned by getTypes() with column defaults for for and type instead of the page's own values. That meant the page listing did not show those records and repeated visits could re-create duplicates. The fix stops new duplicates, but existing mis-scoped rows may need cleanup.
- How do I clean up duplicate type rows after upgrading?
- Run a scoped audit query for rows written by type page visits and group by for, type, and name. Choose a deterministic keep rule per group, delete the rest, and backfill for or type where they reflect column defaults rather than page values. Do this in the same change window as the upgrade and keep the script under review.
- How can I test that repeated type page visits do not create new rows?
- Add a regression test that visits a type page repeatedly and asserts the row count and key values stay stable. That locks down the exact defect class fixed in v5.0.1. Include it in CI so future upgrades cannot reintroduce write-on-view behavior.
- What performance concerns should I watch with filament-types?
- Type page visits are stateful and can write to the database, so avoid unnecessary polling or automated page loads in dashboards and browser tests. v5.0.1 removes a write amplification path, but indexing and benchmarking still matter. Monitor type-table growth and query plans after the upgrade.
- Are there alternatives to tomatophp/filament-types, or should I fork it?
- If you only need static enumerations, native Laravel enums or simple Eloquent relationships may be enough. Choose filament-types when you want database-managed types with a Filament admin resource and fluent registration. For long-term Filament v4 support, track upstream releases or plan a fork if compatibility lags.