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

ActiveLibrary[API Development](/categories/api)

sule/api
========

Helper to create APIs in Laravel.

v2.0.0(12y ago)12399PHPPHP &gt;=5.3.7

Since May 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/feelinc/laravel-api)[ Packagist](https://packagist.org/packages/sule/api)[ RSS](/packages/sule-api/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

Laravel API
===========

[](#laravel-api)

Base library to start creating API using Laravel Framework. Plus support OAuth 2 authorization.

Installation
------------

[](#installation)

### 1. Composer

[](#1-composer)

Open your composer.json file and add the following lines:

```
{
    "require": {
        "sule/api": "2.0.0",
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:feelinc/laravel-api.git",
            "options": {
                "ssl": {
                    "verify_peer": "false"
                }
            }
        }
    ]
    "minimum-stability": "stable"
}e
```

Run composer update from the command line

```
composer update

```

### 2. Service Provider &amp; Aliases

[](#2-service-provider--aliases)

Add the following to the list of service providers in "app/config/app.php".

```
'Sule\Api\ApiServiceProvider',

```

Add the following to the list of aliases in "app/config/app.php".

```
'API'             => 'Sule\Api\Facades\API'

```

### 3. Create Tables

[](#3-create-tables)

Create all required tables from "TABLES.sql" file.

### 4. Configuration

[](#4-configuration)

After installing, you can publish the package's configuration file into your application, by running the following command:

```
php artisan config:publish sule/api

```

Routes
------

[](#routes)

POST /authorization

### Request Headers

[](#request-headers)

```
User-Agent: My User Agent
Content-MD5: md5($stringContent.$clientSecret)

```

### Request Body

[](#request-body)

```
grant_type:    client_credentials
client_id:     JXSb6nEzpQ0e3WAWjsSsZurCaLy0knDjzkwxRlJs
client_secret: C4vpZLRI2kncfXJQZ9l0hdnaTCTupyqF1deCVEPf

```

### Response Body

[](#response-body)

```
{
    "access_token": "jU5vKEBSPSVqRwEXwjIM0N1YefCG0hwqTK5i0UC3",
    "token_type": "bearer",
    "expires": 1399017374,
    "expires_in": 3600
}
```

Filters
-------

[](#filters)

### 1. api.oauth

[](#1-apioauth)

Check route againts authorized client and passed scope, in example checking current client is having "read" scope:

```
Route::get('api/v1/users', array(
    'before' => array(
        'api.oauth:read'
    ), function() {

    }
));
```

### 2. api.content.md5

[](#2-apicontentmd5)

Check request content signature at "Content-MD5" header. Signature should be md5($stringContent.$clientSecret)

```
Route::post('api/v1/users', array(
    'before' => array(
        'api.content.md5',
        'api.oauth:write'
    ), function() {

    }
));
```

### 3. api.ua.required

[](#3-apiuarequired)

Check request "User-Agent" header.

```
Route::post('api/v1/users', array(
    'before' => array(
        'api.ua.required',
        'api.content.md5',
        'api.oauth:write'
    ), function() {

    }
));
```

### 4. api.limit

[](#4-apilimit)

Check request not exceed the limit per each client.

```
Route::post('api/v1/users', array(
    'before' => array(
        'api.ua.required',
        'api.content.md5',
        'api.limit',
        'api.oauth:write'
    ), function() {

    }
));
```

Response
--------

[](#response)

Return JSON response including Limiter and Access-Control-Expose-Headers header

### 1. Single JSON object

[](#1-single-json-object)

```
return API::resourceJson($data = array(), $status = 200, array $headers = array());
```

### 2. Collection JSON object

[](#2-collection-json-object)

```
return API::collectionJson($data = array(), $status = 200, array $headers = array());
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4445d ago

Major Versions

v1.0.0 → v2.0.02014-05-03

### Community

Maintainers

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

---

Top Contributors

[![feelinc](https://avatars.githubusercontent.com/u/345562?v=4)](https://github.com/feelinc "feelinc (63 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.5k91.9M595](/packages/laravel-passport)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[shopware/administration

Administration frontend for the Shopware Core

414.3M116](/packages/shopware-administration)

PHPackages © 2026

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