PHPackages                             teepluss/api - 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. teepluss/api

ActiveLibrary[API Development](/categories/api)

teepluss/api
============

Laravel 4 Internal Request (HMVC)

v1.0.2(11y ago)7034.1k22[2 issues](https://github.com/teepluss/laravel4-api/issues)MITPHPPHP &gt;=5.3.0

Since Oct 30Pushed 10y ago3 watchersCompare

[ Source](https://github.com/teepluss/laravel4-api)[ Packagist](https://packagist.org/packages/teepluss/api)[ Docs](https://github.com/teepluss/laravel4-api)[ RSS](/packages/teepluss-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Laravel HMVC.
-------------

[](#laravel-hmvc)

> This package is no longer updated anymore, Now I've splited this package into 2.

- [HMVC](https://github.com/teepluss/laravel4-hmvc)
- [RESTful format](https://github.com/teepluss/laravel4-restable)

API is a tool for making internal request (HMVC).

### Installation

[](#installation)

- [API on Packagist](https://packagist.org/packages/teepluss/api)
- [API on GitHub](https://github.com/teepluss/laravel4-api)

To get the lastest version of Theme simply require it in your `composer.json` file.

```
"teepluss/api": "dev-master"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Once Theme is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => array(

    'Teepluss\Api\ApiServiceProvider'

)

```

API also ships with a facade which provides the static syntax for creating collections. You can register the facade in the `aliases` key of your `app/config/app.php` file.

```
'aliases' => array(

    'API' => 'Teepluss\Api\Facades\API'

)

```

Publish config using artisan CLI.

```
php artisan config:publish teepluss/api

```

Usage
-----

[](#usage)

API helping you to work with internal request.

- [Internal testing request](#internal-testing-request)
- [Calling via artisan CLI](#calling-via-artisan-cli)
- [Create reponses format for RESTful](#create-reponses-format-for-restful)

### Internal testing request.

[](#internal-testing-request)

```
// GET Request.
API::get('user/1');

// POST Request.
API::post('user', array('title' => 'Demo'));

// PUT Request.
API::put('user/1', array('title' => 'Changed'));

// DELETE Request.
API::delete('user/1');

// Internal request with domain route.
API::invoke('http://api.domain.com', 'post', array('param' => 1))

// You can make remote request without changing code also.
API::post('http://api.github.com', array('username' => 'teepluss'));

// Request remote with invokeRemote.
API::invokeRemote('http://api.github.com', 'post', array('username' => 'teepluss'));

// Get Guzzle to use other features.
$guzzle = API::getRemoteClient();
```

> > Remote request using [Guzzle](http://guzzlephp.org/) as an adapter.

### Calling via artisan CLI.

[](#calling-via-artisan-cli)

```
// Internal GET.
$ php artisan api:call --request GET /some/route?param=value

// Internal POST.
$ php artisan api:call --request POST /some/form --data "name=Tee"

// Remote request.
$ php artisan api:call --request GET http://google.com
```

> > also work with DELETE, PATCH, HEAD

### Create reponses format for RESTful.

[](#create-reponses-format-for-restful)

```
// Response entries.
$users = User::all();
API::createResponse($users);

// Response entry.
$user = User::find($id);
return API::createResponse($user);

// Response Laravel error.
$errors = $validation->messages()->all(':message');
return API::createResponse(compact('errors'), 400);

// Response created data.
$user = Url::create($data);
return API::createResponse($user, 201);

// Response 404.
API::createResponse("User [$id] was not found.", 404);

//Response deleted.
API::createResponse(null, 204);
```

> > For RESTful response recommended to use [Restable](https://github.com/teepluss/laravel4-restable) instead.

Changes
-------

[](#changes)

#### v1.0.1

[](#v101)

- Add artisan CLI.

#### v1.0.0

[](#v100)

- Release first master version.

Support or Contact
------------------

[](#support-or-contact)

If you have some problem, Contact

[![Support via PayPal](https://camo.githubusercontent.com/1c4c2a63b268ab949717893dda9628735444f61b8eb8eece283a534338b5b0e5/68747470733a2f2f7261776769746875622e636f6d2f63687269732d2d2d2f446f6e6174696f6e2d4261646765732f6d61737465722f70617970616c2e6a706567)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9GEC8J7FAG6JA)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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.

###  Release Activity

Cadence

Every ~137 days

Total

3

Last Release

4356d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1464300?v=4)[Maximus](/maintainers/teepluss)[@teepluss](https://github.com/teepluss)

---

Top Contributors

[![fonograph](https://avatars.githubusercontent.com/u/4312895?v=4)](https://github.com/fonograph "fonograph (2 commits)")[![thallisphp](https://avatars.githubusercontent.com/u/754918?v=4)](https://github.com/thallisphp "thallisphp (2 commits)")

---

Tags

apilaravelrestfulhmvclaravel4

### Embed Badge

![Health badge](/badges/teepluss-api/health.svg)

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

###  Alternatives

[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3191.7M10](/packages/api-ecosystem-for-laravel-dingo-api)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

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