PHPackages                             motia/laravel-jms-serializer - 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. [Database &amp; ORM](/categories/database)
4. /
5. motia/laravel-jms-serializer

ActiveLibrary[Database &amp; ORM](/categories/database)

motia/laravel-jms-serializer
============================

0.1.2(6y ago)2191MITPHP

Since Jul 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/motia/laravel-jms-serializer)[ Packagist](https://packagist.org/packages/motia/laravel-jms-serializer)[ RSS](/packages/motia-laravel-jms-serializer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

laravel-jms-serializer
======================

[](#laravel-jms-serializer)

A Library for [serializer](https://jmsyst.com/libs/serializer) intergration with Laravel. Useful to serialize doctrine entities or any plain objects in general.

This package injects into your application two service contracts:

- `DataNormalizer`: converts the data to a php array.
- `ResponseSerializer`: normalizes the data using `DataNormalizer` then builds a `Illuminate\Http\Response` object containting it.

The default implemntation of `ResponseSerializer` follows the [jsend api schema](https://github.com/omniti-labs/jsend)

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

[](#installation)

```
composer require motia/laravel-jms-serializer

```

Register the package service provider by adding it to`config/app.php`

```
  ...
    Motia\LaravelJMSSerializer\SerializerServiceProvider::class
  ...

```

Usage:
------

[](#usage)

- Inside Controllers

```
  // MyController.php
  ...
   public function hello(\Motia\LaravelJMSSerializer\Contracts\ResponseSerializer $serializer) {
     ...
    return $serializer->success($object);
  }
```

- The serializer can also indicate errors and failed requests.

```
    // return a successful response with status 200
    $serializer->success($data = null, $code= 200, $context = null);
    // return a failure response, for example validation
    $serializer->fail($data = null, $code = 422, $context = null);
    // return an error response, for unexpceted errors
    $serializer->error($message, $data = null, $code = 500, $context = null);
    // return the normalized array of the php objects; equivalent to `DataNormalizer::normalize()`
    $serializer->normalize($object, $context = null);
```

Data type serializers
---------------------

[](#data-type-serializers)

The package supports serializing:

- the Laravel pagination object `LengthAwarePaginator``['pagination' => ['total' => 5, 'perPage' => 10... ], 'items' => [...] ] The property `'items' can be renamed using the serializer context `'itemsKey'` property like that:

```
$context = SerializationContext::create()->setAttribute('itemsKey', 'subscribers');

```

The `'items'` property of the array can be renamed using

- `Ramsey\Uuid\Uuid`
- `Carbon\Carbon`: serialized to a ISO8086 string readable by all browsers.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

2400d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20706253?v=4)[Moutia Benachour](/maintainers/motia)[@motia](https://github.com/motia)

---

Top Contributors

[![motia](https://avatars.githubusercontent.com/u/20706253?v=4)](https://github.com/motia "motia (15 commits)")

---

Tags

doctrinejms-serializerlaravel

### Embed Badge

![Health badge](/badges/motia-laravel-jms-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/motia-laravel-jms-serializer/health.svg)](https://phpackages.com/packages/motia-laravel-jms-serializer)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4275.2M26](/packages/horstoeko-zugferd)[webit/w-firma-api

wFirma.pl API

1821.5k](/packages/webit-w-firma-api)[the-don-himself/gremlin-ogm

A PHP Object Graph Mapper for Tinkerpop 3+ compatible Graph Databases (JanusGraph, Neo4j, etc.) that allows you to persist data and run gremlin queries.

171.9k1](/packages/the-don-himself-gremlin-ogm)

PHPackages © 2026

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