jeffersongoncalves/filament-barcode-field
Add barcode input to Filament admin panels with a dedicated, scanner-friendly form field for Laravel. It supports validation and clean integration, helping streamline product, inventory, SKU, asset, and order data capture workflows. Easy to configure and fits naturally into existing Filament resourc...
What it actually is. A single Filament form component, not a panel plugin. BarcodeInput extends Filament\Forms\Components\TextInput, swaps in a custom Blade view, and ships a service provider that registers config, translations, views, and CSS via FilamentAsset::register(). There are two meaningful PHP classes. That is the entire surface area, and it is the most important fact in this assessment: the integration risk is low, the vendor risk is high, and the two are separable.
Architecture fit. Good for teams already on Filament who want camera-based scanning on a form field with near-zero wiring. The TextInput inheritance means every existing modifier (required(), maxLength(), rules(), reactive(), ->live()) still works, and downstream code that type-hints TextInput or reads $state is unaffected. The package does not touch persistence, routing, policies, or queues — there is nothing to reconcile with your domain model.
The limitation worth surfacing to stakeholders: this is an input affordance, not a barcode system. It returns a raw string. It does not return the symbology that was decoded, does not validate check digits (EAN-13/UPC-A mod-10, Code 128 structure), does not normalize GTIN-14 padding, and does not distinguish a 12-digit UPC-E from a truncated EAN-13. Any data-quality guarantee has to be built by you, server-side, behind the rules() you attach to the field.
The value proposition is narrower than it sounds. USB/Bluetooth keyboard-wedge scanners — the standard in warehouse, retail back-office, and clinic check-in — already work with a plain TextInput because they emulate keystrokes. The package's incremental value is specifically camera-based scanning on a device without a hardware scanner, i.e. a phone or tablet browser. If your actual requirement is "scan with the handheld gun we already bought," adopt nothing; you already have it. If the requirement is "our field techs and store associates should scan with the phone in their pocket," this is a fit.
Hard technical constraints to accept up front:
[email protected] is pulled from unpkg.com at runtime via config. No SRI, no bundling. That is a third-party availability dependency on every form render and a likely blocker under a strict script-src CSP. Self-hosting the pinned file is a one-line config change and should be treated as mandatory, not optional.getUserMedia will not run otherwise. This means no meaningful testing on plain-HTTP dev environments and no scanning in kiosk/locked-down browser profiles without a permissions policy.formats, modal width, and reader dimensions live in one published config file. Two fields on the same form needing different symbology sets cannot be expressed without overriding views. For most apps this is fine; for a multi-tenant or multi-domain product it is a design constraint you inherit.Version risk is the loudest signal in the source material. The compatibility table maps 1.x→Filament 3, 2.x→Filament 4, 3.x→Filament 5, and the skill documentation instructs composer require ...:"^3.0" — yet the published release record shows 1.1.0 as latest, dated 2026-09-23, and the repository description says it extends Filament v5. Three artifacts, three different stories about which version pairs with Filament 5. That is not a fatal flaw in a two-class package, but it is exactly the kind of ambiguity that consumes a sprint day during onboarding. Resolve it before committing.
Evidence base. 4 stars, 0 dependents, a single maintainer, dependabot-driven dependency bumps, and a recent i18n contribution of 17 locales. No test suite is documented. The release notes are dominated by funding links and CI housekeeping rather than feature or fix content — a signal that active product development is thin. The counterweight is MIT licensing and a trivially small codebase: the fork cost is measured in hours, not weeks.
Key questions to put to the maintainer or resolve internally:
html5-qrcode asset a supported configuration, and is the pinned version intentionally frozen at 2.3.8?formats() API?Stack fit. Requires Laravel + Filament 5 + Livewire + Tailwind, and a Blade view that renders correctly inside a Filament form schema. If you are on Filament 3 or 4, use the corresponding 1.x/2.x line — do not attempt to force 3.x onto an older core. If you are not on Filament, this package is irrelevant to you entirely.
Migration path. Effectively a no-op. BarcodeInput::make('barcode') is a drop-in for TextInput::make('barcode') with identical state semantics, identical validation hooks, and identical column/file handling. There is no schema change, no data migration, no backfill. The blast radius of a rollback is the same one line.
Recommended adoption shape — insulate, don't inline. Do not reference the vendor namespace directly across dozens of resources. Create a thin local wrapper:
App\Filament\Forms\Components\BarcodeField extends BarcodeInput
and reference only that. This gives you a single swap point if the package is abandoned, lets you add per-field symbology restrictions later without touching call sites, and lets you inject your own check-digit validation rule in setUp().
Sequencing (suggested 3–4 weeks of elapsed time, low effort):
html5-qrcode asset, add it to your CSP script-src, pin the version in your build pipeline, and restrict formats to exactly the symbologies you accept (fewer formats = faster and more reliable decode).TextInput still reachable as the manual-entry path. Capture how often users open the scanner and bail.Compatibility caveats. The component calls parent::setUp() and stores the icon in extraAttributes, and it imports Filament\Support\Enums\Width for modal sizing. Both are internal-ish contracts that can shift across Filament majors. Plan to re-verify visually after every Filament upgrade — this is a UI regression test, not a unit test.
Do not use this for 2D symbologies, for unattended kiosk scanning, for offline/air-gapped deployments, or as the sole input path for any workflow where a failed scan blocks the user.
Maintenance burden: low, but not zero. Two classes and one Blade view. The things that will actually page you are outside the package: the CDN, the CSP, and the browser's camera permission model. Budget roughly a day per Filament major upgrade to re-verify rendering and modal behavior, plus whatever your dependency policy demands for the vendored JS.
Support and vendor risk: the dominant concern. One maintainer, four stars, zero dependents, and release notes weighted toward sponsor links. This is a hobby-scale project. Treat it as such: assume no SLA, no security response process, and no guarantee of a Filament 6 release. Mitigate by (a) vendoring the JS, (b) wrapping the component locally, (c) keeping the fork path warm. Because the code is MIT and tiny, an internal fork is a realistic contingency and should be written into the risk register as the explicit fallback, not a vague worry.
Scaling characteristics. There is no server-side component — no routes, no jobs, no migrations, no database writes. Server load impact is zero. The only scaling dimension is the asset: a CDN fetch per form render where the scanner is used, cached by the browser after first load. Self-hosting moves that to your own static delivery and removes an external egress dependency; either way, it is not a capacity concern. The camera decode runs on the client and will be slower on low-end Android devices; scanner.fps (default 10) and the scan box dimensions are the tuning knobs, and a 1D barcode wants a wide box — the defaults (300x150 scan window, 600x600 reader) are reasonable but should be validated on your actual device fleet.
Failure modes, ranked by likelihood:
TextInput.Observability is the real gap. The package emits nothing. You cannot tell how many users attempt a scan, how many succeed, or which symbologies fail. Instrument it yourself — a client-side event on scan success/failure/manual-entry-fallback, written to your existing analytics — before you roll out broadly. Otherwise you will be making adoption decisions on anecdote.
Ramp-up. An hour for a Filament-fluent developer to read the two classes and the config; the skill documentation and the README cover installation, configuration, and the four common troubleshooting cases. The non-obvious parts — check-digit validation, format normalization, CSP configuration, device testing — are your team's work, not the package's, and should be scoped as such. Total realistic effort for a production-quality integration: 3–5 engineer-days, of which perhaps two hours are the package.
Recommendation. Adopt, with conditions: pin the version, self-host the JS, wrap the component, and own the validation. The package itself is a small, low-risk convenience; the risk sits entirely with its bus factor and your own discipline around data quality.
How can I help you explore Laravel packages today?