Skip to content

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

Notifications You must be signed in to change notification settings

md-aamroni/REST-API-in-PHP

Repository files navigation

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);
});