Download the PHP package forest-lynx/moonshine-decimal-field without Composer

On this page you can find all versions of the php package forest-lynx/moonshine-decimal-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package moonshine-decimal-field

Поле Decimal для Moonshine

Поле для работы с десятичными числами в административной панели MoonShine. Наследуется от поля Text. При редактировании к полю применяется маска @money Alpine.js

Содержание

Установка

Команда для установки:

Использование

[!NOTE] При формировании поля используется NumberFormatter php-intl. По умолчанию данные о локали берутся из настроек проекта, для ее переопределения используйте метод locale()

Методы

locale(string $locale):

precision(int $precision, ?bool $isNaturalNumber):

Пример с натуральным числом, значение поля в базе данных = 12564. Предположим, что с учетом Ваших потребностей оно должно трансформироваться в 125.64:

[!CAUTION] Значения $precision в методах precision(),naturalNumber() перезаписывает данные о количестве знаков дробной части, ранее определенных указанными методами. Например:

Данный код переопределит значение количества знаков после запятой на 4.

[!NOTE] При работе с натуральными числами, со значением поля полученным из request перед сохранением происходит обратная трансформация.

Единицы измерения

Для указания поля, где хранятся единицы измерения:

Методы

unit(string $unit, string|array $data):

unitDefault(mixed $default):

Примеры использования:

Как это выглядит в административной панели: Просмотр Редактирование

Лицензия

Лицензия MIT.


All versions of moonshine-decimal-field with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-intl Version *
moonshine/moonshine Version ^2.13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package forest-lynx/moonshine-decimal-field contains the following files

Loading the files please wait ....