PHPackages                             ananchev/php-api-creator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ananchev/php-api-creator

ActiveLibrary[API Development](/categories/api)

ananchev/php-api-creator
========================

Scalable PHPApiCreator to make API creation easier

v1.0.4(1y ago)011proprietaryPHPPHP &gt;=8.1

Since Sep 17Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ananchevegor/PHPApiCreator)[ Packagist](https://packagist.org/packages/ananchev/php-api-creator)[ RSS](/packages/ananchev-php-api-creator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

PHPApiCreator
=============

[](#phpapicreator)

**PHPApiCreator** is a PHP library designed to simplify the creation of scalable APIs. It provides a structured way to manage database connections, handle HTTP methods (**GET**, **POST**, **PATCH**, **DELETE**), and return consistent **JSON** responses.

---

Features
--------

[](#features)

- **Easy Database Integration**: Connect to a MySQL database effortlessly.
- **HTTP Method Handling**: Supports GET, POST, PATCH, DELETE requests.
- **RESTful Design**: Follows REST principles for API structure.
- **JSON Responses**: Automatically sets headers and outputs in JSON.
- **Error Handling**: Centralized and consistent error responses.

---

Installation
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

```
composer require ananchev/php-api-creator
```

### Or clone the repository

[](#or-clone-the-repository)

```
git clone https://github.com/ananchevegor/PHPApiCreator.git
```

---

Quick Start
-----------

[](#quick-start)

Create an endpoint file (example: `country.php`) and add:

```
