定制 yieldstudio/nova-phone-field 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

yieldstudio/nova-phone-field

Composer 安装命令:

composer require yieldstudio/nova-phone-field

包简介

Nova Phone Number field with a dynamic mask based on the country code inserted by the user.

README 文档

README

Latest Version Total Downloads

Nova Phone Number field with a dynamic mask based on the country code inserted by the user.

Fork from bissolli/nova-phone-field to maintain package.

screenshot of the phone field

Requirements

  • PHP 8.0+
  • Laravel Nova 4.0+
  • Laravel Framework 8.0+

NOTE: For Laravel version < 8.0 or Nova < 4 use bissolli/nova-phone-field.

Installation

You can install this package into a Laravel app that uses Nova via composer:

composer require yieldstudio/nova-phone-field

Usage

Go straight to your Nova resource and use YieldStudio\NovaPhoneField\PhoneNumber field:

namespace App\Nova;

use YieldStudio\NovaPhoneField\PhoneNumber;

class Member extends Resource
{
    // ...
    
    public function fields(Request $request)
    {
        return [
            // ...
            
            PhoneNumber::make('Phone Number'),

            // ...
        ];
    }
}

Now you can view and add tags on the blog posts screen in your Nova app. All tags will be saved in the tags table.

Filtering

By default, every country mask available inside yieldstudio/nova-phone-field/resources/js/data/phone-masks.json will be loaded and working. However, you can always select the desired countries calling the onlyCountries() method.

PhoneNumber::make('Phone Number')
    ->onlyCountries('BR', 'US', 'IE'),

Custom number format

You can also add custom phone formats with withCustomFormats().

PhoneNumber::make('Phone Number')
    ->withCustomFormats('+123 ## #.#', '+123 ## ####.####'),

Or else use only your own phone formats calling for withCustomFormats() among with onlyCustomFormats().

PhoneNumber::make('Phone Number')
    ->withCustomFormats('+123 ## #.#', '+123 ## ####.####')
    ->onlyCustomFormats(),

Migrate from 1.0.x

In 2.0 values are now stored in E.164 format. Previously, the formatted value was stored, which later caused problems for usage.

With the E.164 format, you can use the phone number directly. We use libphonenumber-js to format it on the Index and Detail of your resources.

To replace previously saved values you can use this query :

UPDATE _table_ SET _field_=CONCAT('+', REGEXP_REPLACE(_field_, '\\D', ''))

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail contact@yieldstudio.fr instead of using the issue tracker.

Credits

License

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

yieldstudio/nova-phone-field 适用场景与选型建议

yieldstudio/nova-phone-field 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 285.15k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2022 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「nova」 「laravel」 「input mask」 「phone mask」 「yieldstudio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 yieldstudio/nova-phone-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 yieldstudio/nova-phone-field 我们能提供哪些服务?
定制开发 / 二次开发

基于 yieldstudio/nova-phone-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 285.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 25
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 8
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-01