Download the PHP package jedrzej/pimpable without Composer

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

Pimp your API! Pimp your models!

Does your API need to allow filtering results? Of course it does!

Do you need to sort the results or return selected relations together with your model? I bet you do!

Let's do this!

Pimp your model!

Pimp your API!

What data do you need?

I need all the posts in a thread with ID 42...

...that contain a string "awesome"...

...that are no older than March 2014...

...that have been posted by any user other than the one with ID 666.

One more thing... sort it so that I get active posts at the top...

Oh, and make active and inactive posts sorted by the date they were posted...

Did I mention I need the user data with every post?

Ready... Steady... Go!

GET /api/posts
  ?thread_id=42
  &text=%awesome%
  &created_at=(ge)201403
  &user_id=!666
  &sort[]=is_active,desc
  &sort[]=created_at,desc
  &with=user

BAM! Done! How cool is that!

Overview

Laravel 4/5/6 package that allows to dynamically filter, sort and eager load relations for your models using request parameters.

It combines the following packages:

It simplifies embedding them in your models and allows using all 3 of them with a single function call.

Composer install

Add the following line to composer.json file in your project:

"jedrzej/pimpable": "0.0.6"

or run the following in the commandline in your project's root folder:

composer require "jedrzej/pimpable" "0.0.6"

Usage

Pimp your model

In order to pimp your model class, you need to import PimpableTrait into your model. This will internally import all 3 behaviours.

By default all model fields are searchable and sortable; all relations can be eagerly loaded by default as well. If you need to limit which fields can be filtered and sorted by and which relations can be loaded, see documentation of corresponding behaviour package.

Pimp your API

Once you pimp your model, additional method pimp() will be available on the model that enables the additional behaviour. All criteria will be taken from the request automatically, but if you want to override the request parameters, you can pass the desired value to the pimp() method:

Information how to configure the behaviours using request parameters can be found in documentation of corresponding behaviour package.

Additional configuration

If you are using sort request parameter for other purpose, you can change the name of the parameter that will be interpreted as sorting criteria by setting a $sortParameterName property in your model, e.g.:

If you are using with request parameter for other purpose, you can change the name of the parameter that will be interpreted as a list of relations to load by setting a $withParameterName property in your model, e.g.:


All versions of pimpable with dependencies

PHP Build Version
Package Version
Requires jedrzej/sortable Version 0.0.*
jedrzej/searchable Version 0.0.*
jedrzej/withable Version 0.0.*
illuminate/support 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 jedrzej/pimpable contains the following files

Loading the files please wait ....