Download the PHP package felipeweb11/laravel-easymutators without Composer

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

Value object mutation solution for Laravel 5.

This package provides an easy way to use Value Objects with your eloquent models. A set of mutations is included out of the box in this package, so you can easily upload an Image and/or a File as value object and save it on your eloquent model, and you can also use our Settings value object implementation to save or settings on database.

Here are a few short examples of what you can do:

It can handle your uploads directly like above or fetch directly from an URL:

And you can access them later like this:

Requirements

To create derived images GD should be installed on your server.

Installation

You can install this package via composer using this command:

Next, you must install the service provider:

You can publish the config-file with:

This is the contents of the published config file:

And finally you should add a disk to app/config/filesystems.php. This would be a typical configuration:

Basic usage

Let's use the User class as an example. First you should create fields on your database. Using migrations, you can do this on your users table to create an profile_photo field which will be used to store the users profile photo.

Now you should use the EasyMutatorsTrait on your model and set the mutations fields:

Now you are ready to easily save an image like this:

Handling image conversions

The storage of the files is handled by Laravel's Filesystem, so you can use any filesystem you like. Additionally the package can create image conversions for an specific image. If you want do use this, you can configure image conversions simply by implementing the mapMedia() method on your model, like this:

And you can access them later like this:

Optionally you can set a custom base upload directory for your model, by default the base upload dir is formed by combination of short class name of the model + entity primary key (if exists) + short hash.

Implementing your own value objects

You can create your own value objects by implementing the Webeleven\EloquentValueObject\ValueObjectInterface

And to use, you can configure the attribute on your model:

Or you can configure an alias on easymutators.php config file:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-easymutators with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
laravel/framework Version ^5.1
intervention/image Version ^2.3
felipeweb11/eloquent-value-object Version ^1.1
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 felipeweb11/laravel-easymutators contains the following files

Loading the files please wait ....