- How do I install and set up Filament Types Manager in a Laravel project?
- Run `composer require tomatophp/filament-types`, then execute `php artisan filament-types:install`. Finally, register the plugin in your `AdminPanelProvider.php` under the `types()` method. The package includes a Filament resource for managing types out of the box.
- Does this package work with Laravel 11.x and FilamentPHP v3.x?
- Yes, Filament Types Manager is fully compatible with Laravel 10.x and 11.x LTS versions, and it’s built specifically for FilamentPHP v3.x. Always pin Filament to 3.x in your `composer.json` to avoid compatibility risks.
- What types of database fields can I manage with this package?
- The package supports JSON, arrays, booleans, enums, and polymorphic relations. It’s designed to handle dynamic or reusable types that traditional Eloquent models struggle with, like CMS taxonomies or multi-tenant configurations.
- Can I customize the UI for types, like icons, colors, or labels?
- Absolutely. When registering types, you can define custom labels, icons (using Heroicons or other libraries), and colors. The Filament resource also includes filtering and table columns for easy management.
- Will this package work with my existing FilamentPHP resources?
- Yes, it integrates seamlessly with FilamentPHP v3.x resources. You can extend existing resources or create new ones to manage dynamic types. The package uses Filament’s resource system without breaking changes.
- Are there any performance concerns when using dynamic types in production?
- The package is optimized for performance and includes indexing best practices. However, avoid high-write-throughput systems or complex queries on dynamic types. Benchmark your queries and ensure proper database indexing for large datasets.
- How do I handle migrations if I already have JSON or enum columns in my database?
- Filament Types Manager works with existing schema constraints, but custom migrations may be needed for complex setups. Use Laravel’s schema builders or write custom logic to align your database with the package’s type system.
- What happens if FilamentPHP releases v4.0.0? Will this package break?
- This package is currently locked to FilamentPHP v3.x. If v4.0.0 introduces breaking changes, monitor the package’s GitHub or Filament’s roadmap. Consider forking the package or waiting for an official v4.x update if needed.
- Can I use this for testing dynamic types in CI/CD pipelines?
- Yes, the package includes tests and integrates with Laravel’s testing tools. Use feature tests to verify type management, filtering, and validation logic. The package also supports mocking types for unit tests.
- Are there alternatives to Filament Types Manager for managing dynamic data in Laravel?
- Alternatives include Spatie’s Laravel Media Library (for media types), Nova’s custom fields, or building custom Eloquent traits. However, Filament Types Manager is uniquely optimized for FilamentPHP v3.x and offers a ready-to-use resource with UI customization.