nicehalf / api
There is no license information available for the latest version (v1.1.1) of this package.
Nicehalf API
v1.1.1
2023-02-10 21:33 UTC
Requires
- php: >=8.0
- guzzlehttp/guzzle: ^7.5
README
Introduction
NiceHalf API is a RESTful API that allows you Authentication, Authorization, and CRUD operations on the NiceHalf database.
Getting Started
Prerequisites
Installation
- run this command to install the dependencies
composer require nicehalf/api
- create a
index.php
file in the root directory of your project and add the following code
<?php require_once __DIR__ . '/vendor/autoload.php'; use NiceHalf\Api\AuthAPI; use NiceHalf\Api\CrudAPI; use NiceHalf\Api\LicenseAPI; $auth = new AuthAPI(); $license = new LicenseAPI(); $crud = new CrudAPI();
- run the following command to start the server
php -S localhost:8000
Usage
AuthAPI
Login
$auth->auth();
Logout
$auth->logout();
Get User
$auth->getUser();
LicenseAPI
Check API Connection
$license->check_connection();
Activate License
$license->activate_license($license_key, $client_username);
Verify License
$license->verify_license($time_based_check = false, $license_key = null, $client_username = null);
Deactivate License
$license->deactivate_license($license_key, $client_username);
Check For Updates
$license->check_update();
CrudAPI
Get Rows
$crud->get_rows($table_name, $where = [], $order_by = null, $limit = null, $offset = null);
Get Row
$crud->get_row($table_name, $where = []);
Insert Row
$crud->insert($table_name, $data);
Update Row
$crud->update($table_name, $data, $where = []);
Delete Row
$crud->delete($table_name, $where = []);
License
This project is licensed under the MIT License - You can do whatever you want with it.
Acknowledgments
Copyright
NiceHalf API is © 2023 NiceHalf. All rights reserved.