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

ActiveLibrary[API Development](/categories/api)

jdecano/api
===========

462PHP

Since Sep 19Pushed 11y ago4 watchersCompare

[ Source](https://github.com/johndavedecano/LaravelRESTAPIGenerator)[ Packagist](https://packagist.org/packages/jdecano/api)[ RSS](/packages/jdecano-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

LaravelRESTAPIGenerator
=======================

[](#laravelrestapigenerator)

A simple package that will help you save your time to create a basic RESTful API for Laravel.

How to Install
==============

[](#how-to-install)

1. First clone this package.
2. Edit your app.php and 'Jdecano\\Api\\ApiServiceProvider' to your available service providers.
3. Publish the config "php artisan config:publish jdecano/api"

Usage
=====

[](#usage)

```
php artisan api:make

Eloquent Model e.g User: User

Api Version e.g 1.0: 2.0

```

Configuration
=============

[](#configuration)

The configuration is at app/config/packages/jdecano/api/paths.php

```
return [
    'controller_target_path'   => app_path('controllers'),
    'routes_file'              => app_path('routes.php')
];

```

Example Output
==============

[](#example-output)

After your run the command it will generate the following.

1. If you use User as your model, it will create ApiUserController.php
2. It will add Route::resource('api/1.0/users','ApiUserController'); at the end of the routes file.

Retrive Users
-------------

[](#retrive-users)

**METHOD** - GET

**PATH** - /api/1.0/users

**PARAMS**

1. limit = N
2. index = Where to start
3. where = Find by column e.g first\_name|=|Dave
4. like = Search by column e.g first\_name=Dave

**RETURNS** - JSON

Create User
-----------

[](#create-user)

**METHOD** - POST

**PATH** - /api/1.0/users

**PARAMS** - The column names. Note : Make sure your columns are fillable.

**RETURNS** - JSON

Update User
-----------

[](#update-user)

**METHOD** - PUT/PATCH

**PATH** - /api/1.0/users/{id}

**PARAMS** - The column names. Note : Make sure your columns are fillable.

**RETURNS** - JSON

DELETE User
-----------

[](#delete-user)

**METHOD** - DELETE

**PATH** - /api/1.0/users/{id}

**RETURNS** - JSON

Authentication
==============

[](#authentication)

Wrap your routes with a filter. Heres an example:

Basic HTTP Authentication
-------------------------

[](#basic-http-authentication)

```
// routes.php
Route::group(array('before' => 'auth.basic', function()
{
    // Your route goes here
}));

// filters.php
Route::filter('auth.basic', function()
{
    return Auth::basic('username');
});

```

You can ask authentication from your request header
---------------------------------------------------

[](#you-can-ask-authentication-from-your-request-header)

```
// routes.php
Route::group(array('before' => 'secure_token', function()
{
    // Your route goes here
}));

// filters.php
Route::filter('secure_token', function()
{
    $username = Request::header('username');
    $token = Request::header('token');

    // Then create some kind of validation here
    // If fails then send a 403 Response
    // Easy!
});

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

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/2e0f48ba8dcc70127de6e0284a5558b8e98b469e755393eb823dc76411273b66?d=identicon)[jdecano](/maintainers/jdecano)

---

Top Contributors

[![johndavedecano](https://avatars.githubusercontent.com/u/1860038?v=4)](https://github.com/johndavedecano "johndavedecano (10 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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