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

ActiveMarko-module[API Development](/categories/api)

marko/api
=========

API resource interfaces and value objects for Marko Framework

0.7.0(3mo ago)06MITPHPPHP ^8.5

Since Mar 25Pushed 4w agoCompare

[ Source](https://github.com/marko-php/marko-api)[ Packagist](https://packagist.org/packages/marko/api)[ RSS](/packages/marko-api/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (15)Versions (18)Used By (0)

marko/api
=========

[](#markoapi)

Transform entities into consistent JSON API responses --- define resource classes once and use them everywhere in your API controllers.

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

[](#installation)

```
composer require marko/api
```

Quick Example
-------------

[](#quick-example)

```
use Marko\Api\Resource\JsonResource;

class PostResource extends JsonResource
{
    public function toArray(): array
    {
        return [
            'title'  => $this->resource->title,
            'slug'   => $this->resource->slug,
            'body'   => $this->resource->body,
            'author' => $this->resource->author,
        ];
    }
}

// In a controller:
return new PostResource($post)->toResponse();
// => {"data": {"title": "Hello World", ...}}
```

Documentation
-------------

[](#documentation)

Full usage, API reference, and examples: [marko/api](https://marko.build/docs/packages/api/)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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 ~0 days

Total

16

Last Release

90d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (5 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

PHPackages © 2026

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