/REST-API-in-PHP

A simple application which is build with Object Oriented Design Pattern in Core PHP 7.4

Primary LanguagePHP

RESTFUL API in PHP

RESTful API Workflow

$ composer update
require_once './vendor/autoload.php';
require_once 'config/app.php';

use App\Http\Controllers\ApiController;

$api = new ApiController();

route('posts', $api->index(), function ($data) {
	arrayResponse($data);
});

route('post', $api->show(2), function ($data) {
	arrayResponse($data);
});