Download the PHP package nvmcommunity/alchemist-restful-api without Composer

On this page you can find all versions of the php package nvmcommunity/alchemist-restful-api. 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 alchemist-restful-api

Alchemist Restful API

Project Contributors Project License

Project Stars Project Forks Project Watchers Project Issues

A library that helps you quickly get a rigorous and flexible RESTful-based API interface for your application.

Testing

This package is production-ready with 193 tests and 1151 assertions

Table of Contents

Changelog

Introduction

Alchemist Restful API is a library that helps you quickly get a rigorous and flexible RESTful-based API interface for your application.

The library provides a set of components that you can use to build your API interface, including:

Prerequisites

Installation

Laravel Integration

If you are using Laravel, you can install another package called laravel-eloquent-api to integrate Alchemist Restful API with Eloquent ORM in Laravel.

See more details about how to use nvmcommunity/laravel-eloquent-api package at in the Laravel Eloquent API Documentation

Basic usage

Here is an example of how to use Alchemist Restful API to build a RESTful API interface for an Order API.

Step 1: Define the API class

You need to define an API class that extends the AlchemistQueryable class and implement the methods for field selector, resource filtering, resource pagination, resource search, and resource sort.

Step 2: Validate the input parameters

Make sure to validate the input parameters passed in from the request input by using the validate method.

Step 3: Alright, All the input parameters have been carefully validated

And finally, what you will receive here is fields, filtering, offset, search, and sort parameters from the API client. All have been carefully validated.

More explanation about each component

Below are the detailed explanations of each component that you can use to build your API interface.

Field Selector

The Field Selector component allows your API client to select the fields they want to retrieve, ensuring that all retrieved fields are within your control.

Resource Filtering

Resource Filtering focuses on checking whether the filtering that your API client is using is in the defined filterable list or not.

Filtering Rules

The filtering rules are defined based on the FilteringRules class, which contains the following information:

Supported filtering rules

Filtering operators

Filtering with operator in request input can be represented in form of: <filtering>:<operator>

The operators passed in from the request input (Request Operator) will be converted to the target operator. This table also describes the structure of filtering values for special data types such as: between, not between, in, not in

Supported operators

Request Operator Target Operator Meaning Value Structure
eq \= equal \<value>
ne != not equal \<value>
lt \< lower than \<value>
gt > greater than \<value>
lte \<= lower than or equal \<value>
gte >= greater than or equal \<value>
contains contains (*) contains \<value>
between between (*) between array(\<value[0]>, \<value[1]>)
not_between notbetween (*)_ not between array(\<value[0]>, \<value[1]>)
in in (*) in array(\<value[0]>, \<value[1]>, ...)
not_in notin (*)_ not in array(\<value[0]>, \<value[1]>, ...)

(*) Be careful with these operators because they are not native operators in any database management system; you need to handle them manually.

Resource Pagination

Support pagination through the offset and limit mechanism.

Resource Sort

Support for flexible result returns with data sorted based on the sort and direction specified by the API client.

Resource Search

When filtering through filter, the API client needs to clearly specify the filtering criteria. However, in the case of searching, the API client only needs to pass in the value to be searched for, and the backend will automatically define the filtering criteria from within.

Contributing

Please see CONTRIBUTING for details.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. Contribute.

License

This Project is MIT Licensed


All versions of alchemist-restful-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
nette/utils Version *
psr/http-message Version ^2.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 nvmcommunity/alchemist-restful-api contains the following files

Loading the files please wait ....