PHP Classes

PHP MySQL REST API Generator: Provides an API to access MySQL tables with models

Recommend this page to a friend!

  Author Author  
Picture of Hicri
Name: Hicri <contact>
Classes: 15 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 2x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package provides an API to access MySQL tables with models.

It provides classes that can process HTTP requests from API clients and generate responses using return values from model classes that perform SQL queries to MySQL database tables.

The package provides model classes that store and retrieve user information and perform registration and login information.

An example model class is also provided to implement API functions around an item model class.

Details

PHP- CRUD - Rest API

Single file PHP script that adds a REST API to a MySQL database.

Requirements

- PHP 7.0 or higher with PDO drivers enabled for one of these database systems: - MySQL 5.6 / MariaDB 10.0 or higher for spatial features in MySQL

Configuration

Edit the following lines in the bottom of the file "login.php" and "Item.php":

$vt = $this->Database(
    "Database",
    "localhost",
    "stable",
    "root",
    ""
);


Features

The following features are supported:

- JWT installment - ElastichSearch V2

LOGIN CRUD

The example login table has only a a few fields:

post  
=======
/login     
/login/all  
/login/single
/login/register
/login/update
/login/delete

The CRUD + List operations below act on this table.

Login

To read a record from this table the request can be written in URL format as:

POST /login

Headers

Content-Type : application/json

Body-raw / Json request

{
    "email" : "deneme@gmail.com",
    "password" : "123456",
    "apikey" : "12"

}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{
    "status":1,
    "jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsb2NhbGhvc3QiLCJpYXQiOjE2NDY5NDE2MjMsIm5iZiI6MTY0Njk0MTYzMywiZXhwIjoxNjQ2OTQ1MjIzLCJhdWQiOiJteWxvZ2luIiwiZGF0YSI6eyJpZCI6IjEiLCJlbWFpbCI6ImRlbmVtZUBnbWFpbC5jb20iLCJteWFwaWtleSI6IjEyIn19.5ZFqcYSADVaG0BoFBNtxl5nfjCR7d3Wn8JZ0ra-PcJ8","message":"Succesful"

}

On login operations.

Create

To read a record from this table the request can be written in URL format as:

POST /login/register

Headers

Content-Type : application/json
Authorization : Login JWt 

Body-raw / Json request

{
    "email":"example@example.com",
    "password":"123456",
    "apikey":"555",
    "status":"1",
    "myapi":"12",
    "secret":"stableDeneme"

}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{

    "status":1,
    "message":"Succesful"

}

On create operations.

Read - Single

To read a record from this table the request can be written in URL format as:

POST /login/single

Headers

Content-Type : application/json
Authorization : Login JWT

Body-raw / Json request

{
    "id" : "11",
    "myapi" : "12",
    "secret" : "stableDeneme"

}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{
    "status":1,
    "data":{
        "login_id":"11",
        "login_email":"example@example.com",
        "login_pass":"7c4a8d09ca3762af61e59520943dc26494f8941b",
        "login_apikey":"555",
        "login_status":"1"
        },
    "message":"Succesful"
}

On single read operations.

List

To read a record from this table the request can be written in URL format as:

POST /login/all

Headers

Content-Type : application/json
Authorization : Login JWT

Body-raw / Json request

{
    "myapi" : "12",
    "secret" : "stableDeneme"

}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{
    "status": 1,
    "data": [
        {
            "login_id": "1",
            "login_email": "deneme@gmail.com",
            "login_pass": "7c4a8d09ca3762af61e59520943dc26494f8941b",
            "login_apikey": "12",
            "login_status": "1"
        },
        {
            "login_id": "10",
            "login_email": "tamamd?r@gmail",
            "login_pass": "7c4a8d09ca3762af61e59520943dc26494f8941b",
            "login_apikey": "998",
            "login_status": "1"
        },
        {
            "login_id": "11",
            "login_email": "example@example.com",
            "login_pass": "7c4a8d09ca3762af61e59520943dc26494f8941b",
            "login_apikey": "555",
            "login_status": "1"
        }
    ],
            "message": "Succesful"
}

On read operations.

Update

To read a record from this table the request can be written in URL format as:

POST /login/update

Headers

Content-Type : application/json
Authorization : Login JWT

Body-raw / Json request

{
     "id": "11",
     "email": "example@example.com",
     "password": "555666777",
     "apikey": "555",
     "status": "1",
     "myapi":"12",
     "secret":"stableDeneme"
}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{

    "status": 1,
    "message": "Succesful"

}

On update operations.

Delete

To read a record from this table the request can be written in URL format as:

POST /login/delete

Headers

Content-Type : application/json
Authorization : Login JWT

Body-raw / Json request

{
     "id" : "10",
     "myapi" : "12",
     "secret" : "stableDeneme"
}

Where "1" is the value of the primary key of the record that you want to read. It will return:

{

    "status": 1,
    "message": "Succesful"

}

On delete operations.


  Classes of Hicri  >  PHP MySQL REST API Generator  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP MySQL REST API Generator
Base name: php-rest-api
Description: Provides an API to access MySQL tables with models
Version: 1.0.0
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Databases Database management, accessing and searching View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder image.idea (2 files)
Files folder imagerestAPI (5 files, 6 directories)
Files folder imagesql (1 file)
Accessible without login Plain text file app.txt Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .idea  
File Role Description
  Accessible without login Plain text file modules.xml Data Auxiliary data
  Accessible without login Plain text file vcs.xml Data Auxiliary data

  Files folder image Files  /  restAPI  
File Role Description
Files folder imageControllers (2 files)
Files folder imagehelpers (1 file)
Files folder imagejwt (2 files, 1 directory)
Files folder imagemodels (3 files)
Files folder imagevendor (1 file, 2 directories)
Files folder imageviews (10 files)
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data
  Plain text file Control.php Class Class source
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  restAPI  /  Controllers  
File Role Description
  Plain text file Item.php Class Class source
  Plain text file Login.php Class Class source

  Files folder image Files  /  restAPI  /  helpers  
File Role Description
  Accessible without login Plain text file tool_helper.php Example Example script

  Files folder image Files  /  restAPI  /  jwt  
File Role Description
Files folder imagevendor (1 file, 2 directories)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data

  Files folder image Files  /  restAPI  /  jwt  /  vendor  
File Role Description
Files folder imagecomposer (11 files)
Files folder imagefirebase (1 directory)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  composer  
File Role Description
  Accessible without login Plain text file autoload_classmap.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_namespaces.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_psr4.php Aux. Auxiliary script
  Plain text file autoload_real.php Class Class source
  Plain text file autoload_static.php Class Class source
  Plain text file ClassLoader.php Class Class source
  Accessible without login Plain text file installed.json Data Auxiliary data
  Accessible without login Plain text file installed.php Aux. Auxiliary script
  Plain text file InstalledVersions.php Class Class source
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file platform_check.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  
File Role Description
Files folder imagephp-jwt (3 files, 1 directory)

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  /  php-jwt  
File Role Description
Files folder imagesrc (5 files)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  /  php-jwt  /  src  
File Role Description
  Plain text file BeforeValidException.php Class Class source
  Plain text file ExpiredException.php Class Class source
  Plain text file JWK.php Class Class source
  Plain text file JWT.php Class Class source
  Plain text file SignatureInvalidException.php Class Class source

  Files folder image Files  /  restAPI  /  models  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file itemmodel.php Class Class source
  Plain text file usermodel.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  
File Role Description
Files folder imagebramus (1 directory)
Files folder imagecomposer (11 files)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  vendor  /  bramus  
File Role Description
Files folder imagerouter (7 files, 4 directories)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  
File Role Description
Files folder imagedemo-multilang (2 files)
Files folder imagedemo (2 files)
Files folder imagesrc (1 directory)
Files folder imagetests (2 files)
  Accessible without login Plain text file .php_cs.dist Example Example script
  Accessible without login Plain text file .travis.yml Data Auxiliary data
  Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  demo-multilang  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  demo  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  
File Role Description
Files folder imageBramus (1 directory)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  /  Bramus  
File Role Description
Files folder imageRouter (1 file)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  /  Bramus  /  Router  
File Role Description
  Plain text file Router.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  tests  
File Role Description
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file RouterTest.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  composer  
File Role Description
  Accessible without login Plain text file autoload_classmap.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_namespaces.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_psr4.php Aux. Auxiliary script
  Plain text file autoload_real.php Class Class source
  Plain text file autoload_static.php Class Class source
  Plain text file ClassLoader.php Class Class source
  Accessible without login Plain text file installed.json Data Auxiliary data
  Accessible without login Plain text file installed.php Aux. Auxiliary script
  Plain text file InstalledVersions.php Class Class source
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file platform_check.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  views  
File Role Description
  Accessible without login Plain text file item-create.php Aux. Auxiliary script
  Accessible without login Plain text file item-delete.php Aux. Auxiliary script
  Accessible without login Plain text file item-single.php Aux. Auxiliary script
  Accessible without login Plain text file item-update.php Aux. Auxiliary script
  Accessible without login Plain text file login-create.php Aux. Auxiliary script
  Accessible without login Plain text file login-delete.php Aux. Auxiliary script
  Accessible without login Plain text file login-list.php Aux. Auxiliary script
  Accessible without login Plain text file login-single.php Aux. Auxiliary script
  Accessible without login Plain text file login-update.php Aux. Auxiliary script
  Accessible without login Plain text file login.php Aux. Auxiliary script

  Files folder image Files  /  sql  
File Role Description
  Accessible without login Plain text file stable.sql Data Auxiliary data

Install with Composer Install with Composer - Download Download all files: php-rest-api.tar.gz php-rest-api.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder image.idea (2 files)
Files folder imagerestAPI (5 files, 6 directories)
Files folder imagesql (1 file)
Accessible without login Plain text file app.txt Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .idea  
File Role Description
  Accessible without login Plain text file modules.xml Data Auxiliary data
  Accessible without login Plain text file vcs.xml Data Auxiliary data

  Files folder image Files  /  restAPI  
File Role Description
Files folder imageControllers (2 files)
Files folder imagehelpers (1 file)
Files folder imagejwt (2 files, 1 directory)
Files folder imagemodels (3 files)
Files folder imagevendor (1 file, 2 directories)
Files folder imageviews (10 files)
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data
  Plain text file Control.php Class Class source
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  restAPI  /  Controllers  
File Role Description
  Plain text file Item.php Class Class source
  Plain text file Login.php Class Class source

  Files folder image Files  /  restAPI  /  helpers  
File Role Description
  Accessible without login Plain text file tool_helper.php Example Example script

  Files folder image Files  /  restAPI  /  jwt  
File Role Description
Files folder imagevendor (1 file, 2 directories)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file composer.lock Data Auxiliary data

  Files folder image Files  /  restAPI  /  jwt  /  vendor  
File Role Description
Files folder imagecomposer (11 files)
Files folder imagefirebase (1 directory)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  composer  
File Role Description
  Accessible without login Plain text file autoload_classmap.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_namespaces.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_psr4.php Aux. Auxiliary script
  Plain text file autoload_real.php Class Class source
  Plain text file autoload_static.php Class Class source
  Plain text file ClassLoader.php Class Class source
  Accessible without login Plain text file installed.json Data Auxiliary data
  Accessible without login Plain text file installed.php Aux. Auxiliary script
  Plain text file InstalledVersions.php Class Class source
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file platform_check.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  
File Role Description
Files folder imagephp-jwt (3 files, 1 directory)

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  /  php-jwt  
File Role Description
Files folder imagesrc (5 files)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  restAPI  /  jwt  /  vendor  /  firebase  /  php-jwt  /  src  
File Role Description
  Plain text file BeforeValidException.php Class Class source
  Plain text file ExpiredException.php Class Class source
  Plain text file JWK.php Class Class source
  Plain text file JWT.php Class Class source
  Plain text file SignatureInvalidException.php Class Class source

  Files folder image Files  /  restAPI  /  models  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file itemmodel.php Class Class source
  Plain text file usermodel.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  
File Role Description
Files folder imagebramus (1 directory)
Files folder imagecomposer (11 files)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  vendor  /  bramus  
File Role Description
Files folder imagerouter (7 files, 4 directories)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  
File Role Description
Files folder imagedemo-multilang (2 files)
Files folder imagedemo (2 files)
Files folder imagesrc (1 directory)
Files folder imagetests (2 files)
  Accessible without login Plain text file .php_cs.dist Example Example script
  Accessible without login Plain text file .travis.yml Data Auxiliary data
  Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  demo-multilang  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  demo  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  
File Role Description
Files folder imageBramus (1 directory)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  /  Bramus  
File Role Description
Files folder imageRouter (1 file)

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  src  /  Bramus  /  Router  
File Role Description
  Plain text file Router.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  bramus  /  router  /  tests  
File Role Description
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file RouterTest.php Class Class source

  Files folder image Files  /  restAPI  /  vendor  /  composer  
File Role Description
  Accessible without login Plain text file autoload_classmap.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_namespaces.php Aux. Auxiliary script
  Accessible without login Plain text file autoload_psr4.php Aux. Auxiliary script
  Plain text file autoload_real.php Class Class source
  Plain text file autoload_static.php Class Class source
  Plain text file ClassLoader.php Class Class source
  Accessible without login Plain text file installed.json Data Auxiliary data
  Accessible without login Plain text file installed.php Aux. Auxiliary script
  Plain text file InstalledVersions.php Class Class source
  Accessible without login Plain text file LICENSE Lic. License text
  Accessible without login Plain text file platform_check.php Aux. Auxiliary script

  Files folder image Files  /  restAPI  /  views  
File Role Description
  Accessible without login Plain text file item-create.php Aux. Auxiliary script
  Accessible without login Plain text file item-delete.php Aux. Auxiliary script
  Accessible without login Plain text file item-single.php Aux. Auxiliary script
  Accessible without login Plain text file item-update.php Aux. Auxiliary script
  Accessible without login Plain text file login-create.php Aux. Auxiliary script
  Accessible without login Plain text file login-delete.php Aux. Auxiliary script
  Accessible without login Plain text file login-list.php Aux. Auxiliary script
  Accessible without login Plain text file login-single.php Aux. Auxiliary script
  Accessible without login Plain text file login-update.php Aux. Auxiliary script
  Accessible without login Plain text file login.php Aux. Auxiliary script

  Files folder image Files  /  sql  
File Role Description
  Accessible without login Plain text file stable.sql Data Auxiliary data

Install with Composer Install with Composer - Download Download all files: php-rest-api.tar.gz php-rest-api.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.