Download the PHP package padmission/number-no-intl without Composer

On this page you can find all versions of the php package padmission/number-no-intl. 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 number-no-intl

Laravel Number Without Intl Extension

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package that automatically replaces the default Laravel Number class with a version that doesn't require the PHP intl extension. This is particularly useful for environments where the intl extension cannot be installed or is unavailable.

Important Note

This package only fully supports the English ('en') locale. When using other locales, the formatting will still work, but text-based methods like spell() and spellOrdinal() will fall back to the English implementation or basic number formatting. This is a limitation of the implementation without the intl extension.

Features

Installation

You can install the package via composer:

That's it! No additional configuration is needed. The package will automatically detect if the intl extension is missing and replace Laravel's Number class accordingly.

Usage

Use Laravel's Number class as you normally would. The package will transparently replace it if the intl extension is not available:

All other methods from Laravel's Number class are also available:

Locale Support Limitations

While the package allows you to set different locales using useLocale() or withLocale(), be aware of these limitations:

  1. Text-based methods (spell(), ordinal(), spellOrdinal()) only fully work in English
  2. For non-English locales, text-based methods will either:
    • Fall back to the English implementation
    • Or return basic formatted numbers instead of text
  3. Basic formatting functions (format(), currency(), percentage(), etc.) work for all locales, but use standard English number formatting conventions (comma as thousands separator, period as decimal separator)

If you need full multi-language support, consider:

  1. Installing the PHP intl extension if possible
  2. Or implementing language-specific formatters for your required languages

Configuration

While the package works out of the box with zero configuration, you can publish the configuration file to customize its behavior:

This will create a config/number-no-intl.php file with the following options:

How It Works

The package uses the following approach:

  1. When your application boots, it checks if the intl extension is installed
  2. If intl is available, by default the package does nothing and allows Laravel to use its built-in Number class
  3. If intl is not available, the package automatically binds a polyfill implementation that uses the Symfony polyfill for intl-icu

This ensures that your application works seamlessly across environments, regardless of whether the intl extension is installed or not.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of number-no-intl with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
symfony/polyfill-intl-icu Version ^1.27
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 padmission/number-no-intl contains the following files

Loading the files please wait ....