Download the PHP package coagus/php-api-builder without Composer
On this page you can find all versions of the php package coagus/php-api-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coagus/php-api-builder
More information about coagus/php-api-builder
Files in coagus/php-api-builder
Package php-api-builder
Short Description PHP API Builder is a library designed to simplify the construction of APIs in PHP, ensuring clean, well-structured code, and providing out-of-the-box support for connecting a MySQL database as a resource.
License MIT
Homepage https://github.com/coagus/php-api-builder
Informations about the package php-api-builder
PHP API BUILDER
A library designed to simplify the construction of APIs in PHP, ensuring clean, well-structured code, and providing out-of-the-box support for connecting a MySQL database as a resource.
Installation
Use composer to manage your dependencies and download PHP-API-BUILDER:
Get Started
For the proper functioning of the API, it is necessary to modify the composer.json file and add the .htaccess and index.php files. With this, we can start the development.
composer.json
To maintain order in our API development, we define a name for our project from which all our services will branch out. For this example, my project will be called ‘Services,’ and I will specify that it will be developed in the ‘services’ folder.
.htaccess
This file defines the behavior of our server. Generally, the entry point is our index.php, and the URL does not define the folders within the server.
index.php
The index.php is the entry point to the API; it only defines the project specified in its namespace.
Examples Demo Service
Create a Demo service file in services/Demo.php
GET http://localhost/api/v1/demo
Result:
POST http://localhost/api/v1/demo/hello
Request:
Result: