PHPackages                             mash/mysql-json-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. mash/mysql-json-serializer

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

mash/mysql-json-serializer
==========================

Tools for serialization data to json from mysql

2.1(6y ago)131.1k[5 PRs](https://github.com/AndreyMashukov/mysql-json-serializer/pulls)MITPHPPHP &gt;=7.2

Since Jan 20Pushed 4y ago3 watchersCompare

[ Source](https://github.com/AndreyMashukov/mysql-json-serializer)[ Packagist](https://packagist.org/packages/mash/mysql-json-serializer)[ Docs](https://github.com/AndreyMashukov/mysql-json-serializer)[ RSS](/packages/mash-mysql-json-serializer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (14)Versions (23)Used By (0)

[![Build Status](https://camo.githubusercontent.com/93ba49bbcc22c44ed9def44b399ca336baffa7b404c527c7b4b9babcb19c9b7c/68747470733a2f2f7472617669732d63692e636f6d2f416e647265794d617368756b6f762f6d7973716c2d6a736f6e2d73657269616c697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/AndreyMashukov/mysql-json-serializer) [![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/AndreyMashukov/mysql-json-serializer/blob/master/LICENSE) [![Lasr: Release](https://camo.githubusercontent.com/c9b509b167f0e008c6332d83403f2a00351231bdb830848a060ea989c830667c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616e647265796d617368756b6f762f6d7973716c2d6a736f6e2d73657269616c697a65722e737667)](https://github.com/AndreyMashukov/mysql-json-serializer/releases)

mysql-json-serializer
=====================

[](#mysql-json-serializer)

This solution will help you to get serialized data from mysql

About package
-------------

[](#about-package)

This package allows to get json objects already mapped by created mapping scheme. You will not lost time after query because you will get json from database.

Install
-------

[](#install)

```
composer require mash/mysql-json-serializer
```

Examples
--------

[](#examples)

You will be able to make easy difficult query and get already mapped data. For example I will show you some SQL queries which I created by this package.

#### Example 1 (SELECT JSON WITH OneToMany relation field)

[](#example-1-select-json-with-onetomany-relation-field)

```
