Download the PHP package axm/fluent without Composer

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




Latest Stable Version Total Downloads License



Fluent Interface

The FluentInterface class is a PHP tool that provides a fluent interface for chaining methods and controlling the flow of operations concisely in PHP fluentlications. Its main purpose is to improve code readability, allowing you to chain a series of methods coherently and easy to follow. This is the greatest potential of this interface, it is no longer necessary to repeatedly return the $this object, now FluentInterface handles it automatically for you.

📦 Installation

You can also use Composer to install Axm in your project quickly.

Method Chaining

You can chain multiple methods, which facilitates executing multiple operations sequentially. For example:

Flow Control

The class allows precise control of the method execution flow using if, elseif and else conditions. This is useful to run specific operations based on certain conditions. For example:

Dynamic Instance Creation

You can dynamically create class instances and set them as the current object. This is useful when you need to work with different objects flexibly. For example:

Exception Handling

The FluentInterface class handles exceptions and allows you to throw exceptions during execution, making condition-based decisions and thrown exceptions easier.

Debugging Functions

It offers methods like dd(), dump(), and echo() to aid in debugging and analyzing results.

dd() method

The dd() method (dump and die) is used to debug and analyze the results of the FluentInterface class. You can use it to show the contents of the current variable in detail. If you provide a key ($key), only that specific entry in the results will be shown. Usage example:

dump() method

The dump() method is used to debug and analyze the results of the FluentInterface class. As with dd(), you can provide a key ($key) to show only a specific entry in the results. Usage example:

echo() method

The echo() method is used to print the results of the FluentInterface class. You can optionally provide a value ($value) to print something specific. If no value is provided, it will print all current results. Usage example:

Using Custom Methods

In addition to the built-in methods, you can add your own custom methods using addCustomMethod(). This extends the functionality of the class according to your specific needs.

Interface with Laravel Collections

The class can work with Laravel collections and run collection methods on them. You just need to pass an array as an argument to the FluentInterface class. For example:

Usage Examples of Fluent Interface with an object.

Example 1: Operations on a Numeric Value This example illustrates the use of the MyClass class, which provides a fluent interface to perform operations on a numeric value. The MyClass class has three main methods: increment(), duplicate(), and getValue().

Fluent Interface implementation:

Example 2: User Input Validation This example shows how to validate user input and make decisions based on specific conditions. The FluentInterface class provides a fluent interface to chain methods and control the execution flow effectively.

Example 3: Dynamic Report Generation Imagine you are developing a report generation fluentlication that allows users to configure and customize reports according to their needs. In this situation, FluentInterface can simplify the building of dynamic reports.

Suppose you have a ReportBuilder class that is used to build reports. You can use FluentInterface to chain methods and dynamically configure report components like headers, charts, data, and output formats.

Example 4: Building Configurable Forms Imagine you are developing a form builder platform where users can design their own forms with custom fields. FluentInterface can simplify the creation and manipulation of dynamic forms.

Example 5: Sending Custom Emails Suppose you are developing an fluentlication that sends custom emails to users. FluentInterface can simplify the building of these emails.

Example 6: Generating Dynamic SQL Queries Suppose you are developing a web fluentlication that needs to generate dynamic SQL queries to interact with a database. You can use FluentInterface to build these queries programmatically and readably:

Example 7: Creating Interactive Charts Suppose you are developing a web fluentlication that displays interactive charts to users. FluentInterface can help you construct and configure these charts flexibly:


All versions of fluent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/var-dumper Version ^6.3.5
illuminate/support Version ^10.26.2
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 axm/fluent contains the following files

Loading the files please wait ....