Download the PHP package jimb/restfilter without Composer

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

过滤你的API接口

1在一些API接口中,容易存在不必要的数据,例如某个表格需要输出一个公司的列表,然后列表需要公司的名字,地址,机构代码,id...等等的信息,然后做了这 个接口.在其他的某些地方,例如需要做一个公司的下拉选择框,但这时上述接口却返回许多不必要的数据(地址,机构代码...),明明我只关注的是id,名字 这两个字段,这就容易做成网络io流失了.而restfilter就是在不影响业务代码的情况下解决这个问题.
2把返回json 交给前端,发送的字段会自动补全结构,前端就不会因为找不到字段而报错

安装

使用


使用非常简单,当然下面只是一个例子,把代码放在一个文件,应该是管理类独立开来,数据有在数据模型上取等等


下面的是返回一个对象的

这个 package 只提供过滤功能,详细的Fractal对象接口可以参考
地址 : Fractal

然后访问时在你需要的连接上加上 参数 fields 就可以,例如example 上的

子级别对象的


如果你想更加简单 可以使用 FractalAdapter

参数 fields 是可以修改了,下面讲到
这里显示过滤前改变返回结构和更改过滤的参数名

Laravel 支持

安装依然一样,可以加到 require

注册服务提供者 config/app.php

使用


All versions of restfilter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
league/fractal Version >=0.12.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 jimb/restfilter contains the following files

Loading the files please wait ....