Download the PHP package kamranahmedse/laraformer without Composer

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

Laraformer

Laraformer is a laravel 5.* package that lets you easily introduce a transformation layer for your data.

Laraformer (originated from Laravel Transformers) is a Laravel 5.* package that lets you easily introduce the transformer logic in your Laravel applications.

Features

Two steps installation

All you have to do is install the package and add the service provider

How to use

The installation will automatically setup everything that is there to use the package. Lets get into the real stuff now, shall we?!

Transforming Models

Just add the transformation logic to a method called transform in your model and directly respond with model/collection of models/paginated model response.

You can transform your models in one of the two ways:

Let me explain the usage with an example.

Example

Sample Table/Collection Lets say that we have a users table/collection with the associated model called User. The table/collection looks like following

Column Type Sample Data
id int 120
name string John Doe
profession string Engineer
design_options string (JSON for example) [{"theme_name": "larology", "fields":[{"type": "integer", "name": "some-dummy-field"}]}]
is_admin bool true
created_at datetime 2016-03-04

Required Output And here is the output we need

The Model In order to generate the above ouput, all you need to do is, add a transform method in your model i.e.

a) Automatically transform the response

For the automatic transformation, all you have to do is return the models directly i.e. with the model object, collection of models or a paginated models in the response. For example, the controller may look like below:

b) Manual transformation

If you would like to transform your model data for internal use, you can also do it. For that, you can either do it using a provided facade called \KamranAhmed\Laraformer\Facades\Transformer by using an alias called Laraformer i.e.

Also note that you still have to specify the transform method in the model.

Transforming any Dataset

Not only models, but you can also use laraformer to transform any kind of dataset whether it some data from an external source, some dataset that you magically generated etc. In order to do that, you can do one of the following.

Contributing


All versions of laraformer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
laravel/framework Version ^5.1.11
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 kamranahmedse/laraformer contains the following files

Loading the files please wait ....