PHPackages                             klaasy1/restful - 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. klaasy1/restful

ActiveLibrary[API Development](/categories/api)

klaasy1/restful
===============

A simple Restful library intended for novice developers

015PHP

Since Jul 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/klaasy1/Restful)[ Packagist](https://packagist.org/packages/klaasy1/restful)[ RSS](/packages/klaasy1-restful/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Restful
=======

[](#restful)

This is a simple rest base class for beginners in rest

### Installation

[](#installation)

Either run

```
$ php composer.phar require klaasy1/restful: "dev-master"

```

or add

```
"klaasy1/restful": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

```
use klaasy1\Restful\Restful;

$rest = new Restful();

//This part is your raw data
$myModel = new myModel();
$rawData = $myModel->getRawData();

echo $rest->getData($rawData);
```

Returns a json response as the default. You can set Accept request header to either return xml or html respone, please note that you need to extend AbtractRestful class and implement encodeHtml and encodeXml functions according to your response data needs and use your RestfulClass instead.

\##Example

```
class RestfulClass extends AbtractRestful {

    //Use this as an example to implement this according to your need
    public function encodeHtml($responseData) {

        //Html respose data here
        return $htmlResponse;
    }

    //Use this as an example to implement this according to your need
    public function encodeXml($responseData) {
        //SimpleXMLElement Object
        $xml = new \SimpleXMLElement('');
        //Build your xml document here
        return $xml->asXML();
    }

}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/07049786eca9c00115fb06021d9369959e22900f3961fe4757773a40b1186385?d=identicon)[klaasy1](/maintainers/klaasy1)

---

Top Contributors

[![klaasy](https://avatars.githubusercontent.com/u/12546019?v=4)](https://github.com/klaasy "klaasy (13 commits)")

### Embed Badge

![Health badge](/badges/klaasy1-restful/health.svg)

```
[![Health](https://phpackages.com/badges/klaasy1-restful/health.svg)](https://phpackages.com/packages/klaasy1-restful)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M479](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
