Download the PHP package weebly/laravel-mutate without Composer

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

Eloquent Mutators

License Latest Stable Version StyleCI Tests

This package allows you to map your model attributes to database columns when the type in the PHP model does not match the type in the database column.

This could be using $model->ip_address as a string in your eloquent model but storing it as a BINARY(16) in the database for efficiency. Or having a string always encrypted in the DB but readable in clear form within your models.

Installing

To use this package, you'll need to add the ServiceProvider to the providers array in config/app.php if you are not using automatic package discovery:

You'll also need to publish the config to config/mutators.php with:

Usage

When creating an Eloquent model, you'll need to extend Weebly\Mutate\Database\Model and add $mutate property it:

This will automatically serialize/unserialize the id attribute on the User model when getting/setting the attribute from the database. This allows you to no longer need to set accessors/mutator methods on the model directly.

Note: Unlike the built in Laravel accessors/mutators, this package will serialize the attribute values when they are passed to an Eloquent query builder.

Included Mutators

Creating Custom Mutators

To define a custom mutator, you'll need to create a class that implements Weebly\Mutate\Mutators\MutatorContract, and add it to the enabled array in config/mutators.php.

Note: All attributes are cached on a model instance automatically, so you should not need to add any caching logic at the mutator level.

When building and registering a Mutator, it is important to know that they are resolved automatically from the Laravel IOC container, which means you may create service providers for them if they require custom constructor arguments.

Testing

Running tests:

License

This package is open-sourced software licensed under the 2-Clause BSD license.


All versions of laravel-mutate with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2 || ^8.0
ramsey/uuid Version ~3.0 || ~4.0
laravel/framework Version >=5.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 weebly/laravel-mutate contains the following files

Loading the files please wait ....