jeffersongoncalves/filament-cep-field
Filament CEP Field adds a Brazilian postal code (CEP) input to Filament forms with automatic 99999-999 formatting, validation, and address lookup via BrasilAPI/ViaCEP/AwesomeAPI. Includes Laravel model caching, invalidation, queue support, and full Brazilian states mapping.
Pros:
Cons:
Laravel/PHP Stack Fit:
Key Integration Points:
CepInput::make()).CepCached, CepCacheInvalidated) for custom logic.required(), custom error messages).| Risk Area | Severity | Mitigation |
|---|---|---|
| API Downtime | High | Fallback to cached responses; implement retry logic or local backup APIs. |
| SSL Certificate Issues | Medium | Pre-configure cacert.pem or use Laravel’s HTTP client with custom CA paths. |
| Filament Version Lock | Medium | Pin Filament to ^5.3 to avoid breaking changes (e.g., PageConfiguration). |
| Cache Staleness | Low | Queue-based invalidation ensures freshness; monitor cache hit/miss rates. |
| Regulatory Compliance | Low | Ensure API providers (e.g., ViaCEP) comply with Brazilian data privacy laws. |
API Strategy:
Data Flow:
street, city) in Filament forms, or should we use a separate address resource?Performance:
Localization:
Testing:
Http::fake())?Pre-Installation:
laravel/framework: ^10.0, filament/filament: ^5.3).cacert.pem issues if present).Installation:
composer require jeffersongoncalves/filament-cep-field
php artisan vendor:publish --tag=cep-migrations
php artisan migrate
Form Integration:
CepInput::make() in Filament resources/pages.use JeffersonGoncalves\Filament\CepField\Forms\Components\CepInput;
CepInput::make('cep')
->required()
->setStreetField('address_line_1')
->setCityField('city')
->setStateField('state');
Post-Installation:
01310100 for São Paulo).| Component | Compatibility |
|---|---|
| Filament Forms | ✅ Full support (replaces TextInput for CEP fields). |
| Filament Tables | ❌ No direct support (use for forms only; display CEP as plain text). |
| Livewire | ✅ Underlying Livewire components ensure reactivity. |
| API Providers | ✅ Multi-provider support (configurable via environment variables). |
| Laravel Queues | ✅ Cache invalidation uses queues (no blocking I/O). |
Phase 1: Core Integration
Phase 2: Caching Optimization
Phase 3: Monitoring
monolog channel).Phase 4: Scaling
Pros:
Cons:
Maintenance Tasks:
Common Issues:
cacert.pem setup for devops teams.php artisan cep:clear-cache).Support Channels:
Horizontal Scaling:
Vertical Scaling:
cep_cache table is indexed for fast lookups.Performance Bottlenecks:
How can I help you explore Laravel packages today?