marcelorodrigo/filament-barcode-scanner-field
TextInput inheritance, Livewire integration). This ensures seamless compatibility with Filament’s form system, validation, and UI paradigms.x-load-js) for real-time interaction, which aligns with Filament’s Livewire/Alpine hybrid approach.TextInput, inheriting Filament’s validation, rules, and form logic. Minimal custom logic is required for basic use.use Filament\Forms\Components\TextInput).filament-barcode-scanner-field-assets) for customization, reducing hardcoding.filament/filament:^3.0).mix or Vite configurations.composer require marcelorodrigo/filament-barcode-scanner-field
php artisan vendor:publish --tag=filament-barcode-scanner-field-assets
use Marcelorodrigo\FilamentBarcodeScannerField\Forms\Components\BarcodeInput;
BarcodeInput::make('barcode')
->required()
->rules(['size:13']) // Example: EAN-13 validation
->label('Scan Barcode');
resources/views/vendor/filament-barcode-scanner-field.BarcodeInput::make('barcode')
->extraAttributes(['data-fallback' => 'manual_input_id'])
->afterStateUpdated(fn ($state, $set) => {
if (empty($state)) {
$set('manual_input_id', 'fallback_value');
}
});
BarcodeInputTest).vendor:publish).filament.log for component errors.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Camera permission denied | User cannot scan | Fallback to manual input + clear UI |
| Unsupported browser | Scanner fails silently | Feature detection + graceful degradation |
| Network issues (mobile) | Slow/failed scans | Offline caching or retry logic |
| Invalid barcode format | Form submission fails | Client-side validation + user feedback |
| Filament update breaks package | Component stops working | Test against new Filament versions early |
| High CPU usage | Device overheating/lag | Throttle scan rate or reduce resolution |
How can I help you explore Laravel packages today?