Download the PHP package michael-rubel/laravel-formatters without Composer

On this page you can find all versions of the php package michael-rubel/laravel-formatters. 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 laravel-formatters

Laravel Formatters

Laravel Formatters

Latest Version on Packagist Total Downloads Code Quality Code Coverage GitHub Tests Action Status PHPStan

This package introduces the Formatter pattern you can use to standardize data formats in your Laravel application. You can write your own formatters and put them in app/Formatters folder, then apply them everywhere in your application through format helper. The package uses the Service Container under the hood to easily extend or override the formatter classes.


The package requires PHP 8.1 or higher and Laravel 10 or higher. If you're looking for older versions, check release history.

StandWithUkraine

SWUbanner

Installation

Install the package via composer:

Usage

You can use a shorter version of the string as an alternative:

Available built-in formatters

Artisan command

To make the programmer's life easier, we also added the Artisan command. You can use make:formatter command to generate formatter classes. It will put the class with the given name into app/Formatters folder and auto-inject the stub.

Extending formatters

Since the formatters are resolved through the Service Container they can be easily overridden by extending bindings.

For example in your Service Provider:

Adding custom/overriding package formatters

To add a custom formatter you should create the class that implements the MichaelRubel\Formatters\Formatter interface and put it to the app/Formatters folder. You can put formatter with the same name as the package's to override the formatter from the package. You can customize the folder in the config file.

Examples

You can discover examples of the usage here.

Contributing

If you have written your own formatter and want to add it to this package, PRs are welcomed. But take care of the extendability of the formatter you want to make as built-in and remember to write tests for your use cases.

Testing


All versions of laravel-formatters with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-intl Version *
illuminate/contracts Version ^10.0|^11.0
michael-rubel/laravel-enhanced-container Version ^12.0
spatie/laravel-package-tools Version ^1.16
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 michael-rubel/laravel-formatters contains the following files

Loading the files please wait ....