TINYINT(1), FLOAT, INT(10) UNSIGNED) based on runtime configurations (e.g., required, default, min/max). This aligns well with Laravel’s schema migrations (e.g., Schema::create()) or Eloquent model casting, where column types must be explicitly defined.symfony/framework-bundle suggests it’s designed for Symfony ecosystems. Integration risk: Laravel’s service container and DI system differ from Symfony’s, requiring adapter layers (e.g., wrapping Symfony services in Laravel’s ServiceProvider or Facade).TINYINT(1), FLOAT[(M,D)] syntax). PostgreSQL/SQLite would need customizations.Illuminate\Validation rules).where clauses).getDbField tested) and no Laravel-specific examples. Risk: Undiscovered edge cases (e.g., NULL handling in FLOAT fields).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency | High | Abstract Symfony services via Laravel facades or rewrite core logic. |
| MySQL-Only Syntax | Medium | Override getDbField() for other databases or use conditional logic. |
| Limited Validation | Medium | Pair with Laravel’s FormRequest or Validator. |
| Poor Documentation | High | Invest in mapping Symfony concepts to Laravel (e.g., "How to use this in a Laravel migration"). |
| Zero Community Adoption | High | Fork and extend for Laravel-specific needs. |
Schema::table() or create() offers?getDbField() be customized?FormRequest or API resource validation?spatie/laravel-model-states or custom traits achieve similar goals with lower risk?FilterBundle must be registered as a Laravel service provider. Key classes (e.g., BooleanFilter, FloatFilter) should be bound to the container.config/packages/filter.yaml) should be replaced with Laravel’s config/filter.php or environment variables.DB::connection()->getDoctrineSchemaManager() for cross-DB support if needed.Illuminate\Validation\Rule or Laravel\Nova\Rules for API/admin interfaces.FilterQueryBuilder trait to dynamically apply where clauses.Phase 1: Schema Generation
Schema::create() calls with dynamic generation:
use Alhames\FilterBundle\Filter\BooleanFilter;
$booleanFilter = new BooleanFilter(['required' => true]);
$column = $booleanFilter->getDbField();
Schema::create('filters', function (Blueprint $table) use ($column) {
$table->raw($column, 'is_active');
});
getDbField() returns invalid SQL for non-MySQL.Phase 2: Validation Layer
FilterValidator class to map bundle configs to Laravel validation rules:
$validator = new FilterValidator($filterConfig);
$rules = $validator->getRules(); // Returns ['is_active' => 'required|boolean']
FormRequest or API resources.Phase 3: Query Integration
FilterQuery facade to translate filter configs into Eloquent queries:
$query = FilterQuery::apply($request->filters, User::query());
| Symfony Concept | Laravel Equivalent |
|---|---|
FilterBundle |
Custom ServiceProvider |
| YAML Config | config/filter.php |
| Dependency Injection | Laravel’s container |
| Event Dispatcher | Laravel’s Events facade |
Symfony\Component\Yaml\Yaml).Twig templates (if any) with Laravel’s Blade or inline PHP.BooleanFilter for a single migration/table.Schema::create() and Artisan::call('migrate').FilterValidator and test with FormRequest.FilterQuery and test with Eloquent relationships.getDbField() with database-aware logic (e.g., DB::connection()->getDatabasePlatform()).config/filter.php).FloatFilter for PostgreSQL").laravel-filter-bundle fork with Laravel-specific examples.where clauses could impact query planning if overused.TINYINT, FLOAT, etc.DatabasePlatform adapter layer.| Scenario | Impact | Detection | Recovery |
|---|---|---|---|
| Invalid SQL for non-MySQL | Migration failures | CI tests with PostgreSQL/SQLite | Override getDbField() per DB |
| Missing Validation Rules | API/data corruption | Unit tests for FilterValidator |
Add fallback Laravel rules |
| Symfony Service Not Found | Runtime errors | Container binding checks | Mock Symfony services in tests |
| Configuration Merge Conflicts | Silent defaults | Config validation in boot() |
Explicit config precedence rules |
config/ system.How can I help you explore Laravel packages today?