Download the PHP package megaads/apify without Composer

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

Apify

A pretty library to help developers build RESTful APIs lightly, quickly and properly even without writing code.

It's always easy to customize to suit any need such as defining data relationships, authorization, caching, communicating or integrating into other systems.

Features

Using Apify

Installation

Apify is packed as a composer package. So it's installed quickly in 2 steps

  1. Require the composer package

    composer require megaads/apify

  2. Register the provider:

    Megaads\Apify\ApifyServiceProvider

System requirements

API Overview

HTTP Method API URL Description For example
GET /api/entity List all records of table that match the query curl http://my-api.com/api/user?filters=age>20
GET /api/entity/:id Retrieve a record by primary key :id curl http://my-api.com/api/user/123
POST /api/entity Insert a new record, bulk inserting is also avaiable curl -X POST http://my-api.com/api/user -d '[{"username":"user1", "age":"20"},{"username":"user2", "age":"25"}]' -H "Content-Type: application/json"
PUT /api/entity/:id Replaces existed record with new one curl -X PUT http://my-api.com/api/user/123 -d '{"id":"123", "username":"user1", "age":"20"}' -H "Content-Type: application/json"
PATCH /api/entity/:id Update record element by primary key curl -X PATCH http://my-api.com/api/user/123 -d '{"age":"21"}' -H "Content-Type: application/json"
DELETE /api/entity/:id Delete a record by primary key curl -X DELETE http://my-api.com/api/user/123
DELETE /api/entity Delete bulk records that match the query curl -X DELETE http://my-api.com/api/user?filters=age>100
POST /api/upload Upload a file curl -X POST http://my-api.com/api/upload -H "Content-Type: multipart/form-data" -F "[email protected]"

Pagination

Parameter Required Default Description
page_id No 0 Page index, start at 0
page_size No 50 Number of rows to retrieve per page

Sorting

Order by multiple columns using sorts parameter

Sort ascending

Sort descending

Sort by multiple columns

Selection

Select columns from the records using fields parameter. SQL aggregate functions such as COUNT, MAX, MIN, SUM, AVG, SQL aliases are also available

Group By

Group the result-set by one or more columns using groups parameter and combine with aggregate functions using Selection

Filtering

Operator Condition For example
= Equal to /api/post?filters=user_id=1
!= Not equal /api/post?filters=user_id!=1
> Greater /api/post?filters=user_id>1
>= Greater or equal /api/post?filters=user_id>=1
< Less /api/post?filters=user_id<1
<= Less or equal /api/post?filters=user_id<=1
={} In /api/post?filters=user_id={1;2;3}
!={} Not in /api/post?filters=user_id!={1;2;3}
=[] Between /api/post?filters=user_id=[1;20]
!=[] Not between /api/post?filters=user_id!=[1;20]
~ Like /api/post?filters=title~hello
!~ Not like /api/post?filters=title!~hello

Apify supports filtering records based on more than one AND, NOT condition by using comma. For example:

Complex conditions that combine AND, OR and NOT will be available soon.

Scope functions

Entity conventions

Apify works by a simple mechanism, looking for a model class that correspond to the API entity, otherwise the API entity will be matched to a suitable DB table. That means no model class is required to create, do it only in the case of defining relationships, customizing.

So API entity name should follow one of the conventions:

Relationships

Apify is packed into a Laravel/ Lumen package so relationships also are defined as methods on Eloquent model classes.

See Laravel docs for details: https://laravel.com/docs/5.6/eloquent-relationships

Let's consider the following relationship definations:

Selection on relationships

Apify provides the ability to embed relational data into the results using embeds parameter

For example

Even nested relationships

Filtering on relationships

Metric

metric=get (by default): Retrieve all records that match the query

or

Response format

metric=first: Retrieve the first record that matchs the query

Response format

metric=count: Retrieve the number of records that match the query

Response format

metric=increment/ decrement: Provides convenient methods for incrementing or decrementing the value of a selected column

Response format

Event Bus

Is being updated ...

.env configurations

Key Default value Description
APIFY_PREFIX_URL api API URL prefix
APIFY_MODEL_NAMESPACE App\Models Models namespace
APIFY_UPLOAD_PATH /home/upload Upload path
APIFY_MQ_ENABLE false Enable / Disable Message queue (Event Bus)
APIFY_MQ_HOST Message queue server host
APIFY_MQ_PORT Message queue server port
APIFY_MQ_USERNAME Message queue authentication - username
APIFY_MQ_PASSWORD Message queue authentication - password
APIFY_MQ_EXCHANGE apify Message queue exchange name

Authenticate Apify & authorize Apify?

Read docs here : https://github.com/megaads-vn/apify/blob/master/README-AUTH.md

License

The Apify is open-sourced software licensed under the MIT license

Contact us/ Instant feedback

Email: [email protected]

Skype: phult.bk

If you find a bug, please report it here on Github.


All versions of apify with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
php-amqplib/php-amqplib Version ^2.7
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 megaads/apify contains the following files

Loading the files please wait ....