Download the PHP package qpi/laravel without Composer

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

Qpi

Qpi is a query language for APIs and a runtime for fulfilling those queries with your existing data. Qpi provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time.

First of all, you should know that Qpi is an idea and you can implement it in your own language. This project is just a Qpi implementation for Laravel.

Usage

1) Install it:

2) Add to providers

Open your Laravel config file config/app.php and add the following lines.

In the $providers array add the service provider for this package.

3) Update autoload:

Configuration

First, you need to publish configuration file.

The configuration file is copied to config/qpi.php.

Registering models

To give access to the models, you have to register your models in config/qpi.php.

Quick Tutorial

This package will introduce two new routes to your app. /query/{query} and /schema.

If you want to make a query, just use the first endpoint like this:

And if you want to see the manual of your models, use the second endpoint: /schema.

The Query Language

Now, you just need to know how to use it. As I said, it's query language and you have to need to learn it to make your queries. It's a simple language with few tips. Please follow the next steps.

So let's start. Each query must be between curly braces:

In the body of each query you have to define which model you want to fetch:

In the above query, we want to fetch the book model. Someone may ask, what are the next curly braces? Those curly braces are just to tell Qpi which fields of that model you want to fetch. If I want to complete my query, It will be like this:

If you don't specify any field, it will return all of available fields.

Nested queries: Imagine want to fetch the author of each book. So how can we do that?

You see that Qpi supports making queries for nested models.

Limiting results: If you want to specify how many records to fetch, you can do that like this:

I used above syntax to tell Qpi that I want to limit results to just 5 records. In other words, the parenthesis syntax is just this: (offset, limit).

Where statements:

You have to use brackets in order to write your where statements.

Operators:

Operator Name Example
= Equal id=5
> Greater than id>2
< Less than id<6
! Not equal id!6
~ Like name~'john%'
| OR id<6|id>3
& AND id=6&id=3

Order by:

You can add a colon after every field witch you want to order results by it. After colon you have to tell Qpi the direction. 1 for ASC and 0 for DESC.

Query batching:

With a single request, you can fetch all of your needs. Just put your queries into curly braces.

Above, you see two different queries but you can fetch it with a single request.

Authorization

To enable authorization for models, you should add qpiAccess method to each model. Qpi will call this method in each request that want's to have access to that model and if the model throws an error, Qpi will reject the request.

Note that Qpi will inject dependencies to this method.

Schema (Comming soon...)

Your users can make request to /schema to see the schema of models. In order to do that, your models should have two optional static properties $qpiProps and $qpiRelations.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.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 qpi/laravel contains the following files

Loading the files please wait ....