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

This package is auto-updated.

Last update: 2024-05-11 00:13:14 UTC


README

Introduction

NiceHalf API is a RESTful API that allows you Authentication, Authorization, and CRUD operations on the NiceHalf database.

Getting Started

Prerequisites

  • PHP >= 8.0.0
  • Composer
  • Laravel >= 9.0.0 / Only if you want to use the AuthAPI class (optional)

Installation

  1. run this command to install the dependencies
composer require nicehalf/api
  1. 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();
  1. 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.

Contact