ejoi8 / filament-qr-scanner
QR scanner plugin for Filament tables and text inputs.
Package info
github.com/ejoi8/filament-qr-scanner
Language:Blade
pkg:composer/ejoi8/filament-qr-scanner
Requires
- php: ^8.3
- filament/filament: ~5.4.0
- illuminate/support: ^13.0
This package is auto-updated.
Last update: 2026-04-04 01:56:44 UTC
README
QR scanner utilities for Filament tables and form fields.
GitHub: ejoi8/filament-qr-scanner
Requirements
- PHP 8.3+
- Laravel 13.x
- Filament 5.4.x
What It Does
- provides a ready-made
Scanheader action - opens a camera scanner in a Filament modal
- applies the scanned value to
tableSearch - adds
TextInput::qrScan()for scanning directly into a field - keeps normalization overridable per host page
Installation
Published Package
composer require ejoi8/filament-qr-scanner php artisan filament:assets
Local Path Package
If you are consuming the package locally before publishing it:
{
"repositories": [
{
"type": "path",
"url": "../filament-qr-scanner"
}
]
}
composer require ejoi8/filament-qr-scanner php artisan filament:assets
Register The Plugin
Register the panel plugin in your Filament panel provider:
use FilamentQrScanner\FilamentQrScannerPlugin; return $panel ->plugin(FilamentQrScannerPlugin::make());
Use On A ListRecords Page
Add the trait and the ready-made header action to your Filament ListRecords page:
<?php namespace App\Filament\Resources\Products\Pages; use App\Filament\Resources\Products\ProductResource; use Filament\Actions\CreateAction; use Filament\Resources\Pages\ListRecords; use FilamentQrScanner\Tables\Actions\ScanTableSearchAction; use FilamentQrScanner\Tables\Concerns\InteractsWithScannedTableSearch; class ListProducts extends ListRecords { use InteractsWithScannedTableSearch; protected static string $resource = ProductResource::class; protected function getHeaderActions(): array { return [ ScanTableSearchAction::make(), CreateAction::make(), ]; } }
Use On A Text Input
Once the plugin is registered, any Filament TextInput can add a QR scan suffix action:
use Filament\Forms\Components\TextInput; TextInput::make('serial_no') ->qrScan();
Scanning writes the captured value back into that field's state path, then closes the modal.
Custom Normalization
By default, the package only applies trim() to the scanned value.
If your table searches uppercase identifiers, override the normalization method on the host page:
use Illuminate\Support\Str; protected function normalizeScannedTableSearch(string $code): string { return Str::upper(trim($code)); }
Scope
Current scope:
- Filament
ListRecordspages only - Filament
TextInputfields via->qrScan()
Not included yet:
- relation managers
- non-
TextInputform fields - configurable labels or debounce timing
Notes
- The scanner writes to Filament's
tableSearchflow throughapplyScannedTableSearch(). - Camera access requires
https://orlocalhost. - After package updates, run
php artisan filament:assets. - Source:
https://github.com/ejoi8/filament-qr-scanner