Download the PHP package conedevelopment/blade-filters without Composer

On this page you can find all versions of the php package conedevelopment/blade-filters. 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 blade-filters

Blade Filters

Use string filters easily in Laravel Blade.

If you have any question how the package works, we suggest to read this post: Laravel Blade Filters.

Getting started

You can install the package with composer, running the composer require conedevelopment/blade-filters command.

Using the filters

You can use the filters in any of your blade templates.

Regular usage:

Chained usage:

Passing non-static values:

Passing variables as filter parameters:

Built-in Laravel functionality:

Limitations

Echos

Laravel supports three types of echos. Raw – {!! !!}, regular – {{ }} and escaped (legacy) – {{{ }}}. Filters can be used only with regular echos. Also, filters cannot be used in blade directives directly.

Why? Raw should be as it is. Forced escaping should be escaped only, without modification.

Bitwise operators

Bitwise operators are allowed, but they must be wrapped in parentheses, since they are using the same "pipe operator".

The Filters

About the filters

Filters are string functions, that are defined in the Pine\BladeFilters\BladeFilters facade. It has several reasons, that are discussed in the Create custom filters section.

The available filters

The package comes with a few built-in filters, also the default Laravel string methods can be used.

Currency

Passing false as the second parameter will align the symbol to the right.

Date

Lcfirst

Unlike PHP's default lcfirst(), this filter works with multi-byte strings as well.

Reverse

Substr

Trim

Ucfirst

Unlike PHP's default ucfirst(), this filter works with multi-byte strings as well.

Supported built-in Str functions

Create custom filters

As it was mentioned before, every filter is a method that can be called through the Pine\BladeFilters\BladeFilters facade. It has several reasons why is this approach better, but let's take the most important ones:

Parameter ordering

PHP is not very strict regarding to function's parameter ordering and this way it's easier to coordiante or override them. Also, sometimes it happens with Laravel's string functions. It's important that only those functions can be used, that accept the parameters in the following order:

  1. The value to be transformed
  2. Any other parameter if needed

For example:

Defining custom filters

Since the filters are only methods that are defined in the Str facade and the BladeFilters class, to create filters, you need to create a macro in a service provider's boot() method.

Contribute

If you found a bug or you have an idea connecting the package, feel free to open an issue.


All versions of blade-filters with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0
illuminate/view Version ^8.0 || ^9.0 || ^10.0
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 conedevelopment/blade-filters contains the following files

Loading the files please wait ....