Download the PHP package darkghosthunter/fluid without Composer

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

Aaron Burden - Unsplash (UL) #Kp9z6zcUfGw

Latest Stable Version License Coverage Status Maintainability

Fluid

A flexible class based on the famous Laravel's Fluent and Eloquent Model class.

Fluid will allow you to flexible manipulate a class as a bag of properties (or array keys), and allow simple serialization while hiding sensible data from your users.

Installation

Fire up composer and require it into your project.

Otherwise, you can just download this as a ZIP file and require it manually in your code:

Usage

The Fluid class is a class that can be accessed as a normal object or array. It can be serialized to an array, string or JSON.

You can instance Fluid like the normal way, or just using make():

You can also use fromJson() if you need to make an instance from a JSON string:

To be totally safe to use, these static helper methods will return your class that extended the Fluid instead of the base class. So using Oil::make() will return an instance of Oil.

Override the static helpers

Fluid uses the magic of __callStatic to create a new instance. In previous versions you could not override the static methods with your own logic, but now you can:

Attributes

Every attribute lies inside a protected array called $attributes, and each of these can be set as it was a property or an array.

For convenience, if a property or array key doesn't exists it will return null.

Serializing

Serializing means taking the class to another representation, like an array or string.

To serialize as an array, use the toArray() method.

Since there is no magic for using (array)$fluid, the latter will serialize every property, so to avoid that.

Serializing to a string will output JSON, as with the toJson() method.

Hiding attributes from serialization

Sometimes is handy to hide attributes from serialization, like application keys, API secrets, user credentials or certificate locations.

You can turn this on using shouldHide() method, or if you're extending Fluid, setting $shouldHide to false.

Set the attributes to hide inside the $hidden property. Alternatively, you can use the setHidden() method after is instanced.

Fillable

Sometimes you want to ensure the user doesn't fill anything more than some predetermined attributes. You can use the FluidFillable class to enforce this.

You can put the attributes allowed to be set in the $fillable array or use setFillable() afterwards.

The user will get a InvalidAttributeException when trying to set an attribute which is not fillable in the class.

You can use this to force developers to only allow certain attributes inside an instance, allowing you to displace any filtering logic once the instance is processed in your application.

License

This package is licenced by the MIT License.


All versions of fluid with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
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 darkghosthunter/fluid contains the following files

Loading the files please wait ....