承接 swiftmade/nova-money-field 相关项目开发

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

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

swiftmade/nova-money-field

最新稳定版本:v1.5.0

Composer 安装命令:

composer require swiftmade/nova-money-field

包简介

A Laravel Nova field for Money.

README 文档

README

This is a fork of vyuldashev/nova-money-field with the following changes:

  • Added support for moneyphp v4.0

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require swiftmade/nova-money-field

Usage

In resource:

// ...
use Vyuldashev\NovaMoneyField\Money;

public function fields(Request $request)
{
    return [
        // ...
        Money::make('Balance'),
    ];
}

USD currency is used by default, you can change this by passing second argument:

Money::make('Balance', 'EUR'),

You may use locale method to define locale for formatting value, by default value will be formatted using browser locale:

Money::make('Balance')->locale('ru-RU'),

If you store money values in database in minor units use storedInMinorUnits method. Field will automatically convert minor units to base value for displaying and to minor units for storing:

Money::make('Balance', 'EUR')->storedInMinorUnits(),

If you need to use a name that doesn't convert to the column name (eg 'Balance' as name and remaining_balance as column) you can pass this as the 3rd argument to the make/constructor.

Please Note: that this, along with all field column names, should be present and usable within your model class else you may encounter SQL errors.

Money::make('Balance', 'EUR', 'remaining_balance'),

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 37
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-11