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

ActiveProject[API Development](/categories/api)

skrip42/api-skeleton
====================

v2.0.1(4y ago)15MITPHPPHP &gt;=7.2.5

Since Feb 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Skrip42/api-skeleton)[ Packagist](https://packagist.org/packages/skrip42/api-skeleton)[ RSS](/packages/skrip42-api-skeleton/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (12)Versions (8)Used By (0)

api-skeleton
============

[](#api-skeleton)

symfony api skeleton

Features out of the box
-----------------------

[](#features-out-of-the-box)

- authorization by token
- serializer for api with error catching
- put/patch parameters available
- correct validation of the entity without form
- logging requests
- crun-rest maker

Creating new project
--------------------

[](#creating-new-project)

```
composer create-project skrip42/api-skeleton
```

create .env.local and and add environment variable definitions to it:

- API\_KEY - you api authentification key

Usage
-----

[](#usage)

### Serializer

[](#serializer)

```
/** in you controller */

class CustomController extends AbstractApiController //extends AbstractApiController
{
    public function sameMethod() : Response
    {
        ...
        //use api(mixed $data, array $meta = []) method to serialize response
        return $this->api($dataOrEntity);
    }

    ...
```

#### use serialization group

[](#use-serialization-group)

```
    //in you entity/DOT class
    /** @Groups("groupName") */
    private $field; //add annotation to filed

    /** @Groups("groupName") */
    public function GetField(): fieldtype //or to you public method

    //in you controller
    return $this->api(
        $dataOrEntity,
        [
            'groups' => 'groupName'
        ]
    );
```

#### use pagination

[](#use-pagination)

```
    //in you controller print some like this
    $page = $request->query->getInt('page', 1);
    $count = $repository->count([]);
    $perPage = $request->query->getInt('perPage', $count);
    $sort = $request->query->get('sort');
    $entities = $repository->findBy(
        $params,
        $sort,
        $perPage,
        $perPage * ($page - 1)
    );
    $this->api(
        $entities,
        [
            'currentPage' => $page,
            'perPage' => $perPage,
            'pagesTotal' => ceil($count / $perPage)
        ]
    );
```

#### error with http status code

[](#error-with-http-status-code)

```
use App\Exceptions\ApiException;
...
throw new ApiException($message, $statusCode);
```

### Entity validation (doctrineORM required)

[](#entity-validation-doctrineorm-required)

- uncomment App\\EntityListener block in services.yaml
- implement App\\Entity\\ValidationInterface in you Entity
- add @ORM\\EntityListeners({"App\\EntityListener\\ValidateListener"}) annotation in you Entity
- profit!

### RestCRUD maker (doctrineORM required)

[](#restcrud-maker-doctrineorm-required)

- uncomment App\\Maker\\MakeRest block in services.yaml
- run ./bin/console make:rest command to create RestCRUD controller for you entity

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~58 days

Total

7

Last Release

1740d ago

Major Versions

v1.0.5 → v2.0.02021-09-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac2ab44421653cebc795140356530287c37ba8c2011790683db6d2b316ea0e8d?d=identicon)[skrip42](/maintainers/skrip42)

---

Top Contributors

[![Skrip42](https://avatars.githubusercontent.com/u/11675343?v=4)](https://github.com/Skrip42 "Skrip42 (18 commits)")

### Embed Badge

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

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

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[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)

PHPackages © 2026

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