momenoor/filament-serial 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

momenoor/filament-serial

最新稳定版本:v1.0.0

Composer 安装命令:

composer require momenoor/filament-serial

包简介

A Filament V3 form macro for `TextInput` that allows you to easily format and manage serial numbers with optional prefixes, suffixes, separators, and padded digits.

README 文档

README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

A Filament V3 form macro for TextInput that allows you to easily format and manage serial numbers with optional prefixes, suffixes, separators, and padded digits.

✨ Features

  • Format serial numbers in Filament forms.
  • Support for:
    • Prefix and/or suffix
    • Custom separator
    • Fixed digit zero-padded numeric part
  • Automatically formats on blur and focus
  • Saves only numeric part to database
  • Built-in Alpine.js interactivity
  • Simple integration with Filament TextInput

📦 Installation

You can install the package via Composer:

composer require momenoor/filament-serial

This package auto-registers itself. No need to publish anything.

⚙️ Usage

use Filament\Forms\Components\TextInput;

TextInput::make('serial_number')
    ->label('Serial Number')
    ->serial(
        prefix: 'INV',     // Optional string or Closure
        suffix: 'UAE',     // Optional string or Closure
        separator: '-',    // Default is "-"
        length: 6          // Default is 8
    );

Example

Interaction Value Example
On blur INV-000123-UAE
On focus 123
In database 000123

🛠 Parameters

Parameter Type Description
prefix string|Closure Text before the numeric part
suffix string|Closure Text after the numeric part
separator string String between segments (default: -)
length int Number of digits in the numeric part (default: 8)

✅ Compatibility

  • Laravel 10+
  • Filament 3.x
  • PHP 8.1+

📄 Changelog

Please see CHANGELOG for more information on recent changes.

🤝 Contributing

Please see CONTRIBUTING for details.

🔐 Security

If you discover any security-related issues, please review the security policy.

🙌 Credits

📜 License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固