承接 ejoi8/filament-qr-scanner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ejoi8/filament-qr-scanner

最新稳定版本:v0.1.0

Composer 安装命令:

composer require ejoi8/filament-qr-scanner

包简介

QR scanner plugin for Filament tables and text inputs.

README 文档

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 Scan header 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 ListRecords pages only
  • Filament TextInput fields via ->qrScan()

Not included yet:

  • relation managers
  • non-TextInput form fields
  • configurable labels or debounce timing

Notes

  • The scanner writes to Filament's tableSearch flow through applyScannedTableSearch().
  • Camera access requires https:// or localhost.
  • After package updates, run php artisan filament:assets.
  • Source: https://github.com/ejoi8/filament-qr-scanner

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固