PHPackages                             danack/convert - 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. danack/convert

ActiveLibrary

danack/convert
==============

Converts between objects and scalars trivially.

0.1.0(6y ago)03MITPHPCI failing

Since Mar 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Danack/Convert)[ Packagist](https://packagist.org/packages/danack/convert)[ RSS](/packages/danack-convert/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Convert
=======

[](#convert)

A lightweight library for making it easier to convert objects to and from arrays, and to and from Json.

[![Actions Status](https://github.com/Danack/Convert/workflows/Tests/badge.svg)](https://github.com/Danack/Convert/actions)

Design goals
============

[](#design-goals)

The library was designed to make it as simple as possible to make your data be convertible to Json for simple cases, and then be easy to customise how the objects are converted for more advanced cases.

Example
=======

[](#example)

After adding the `Convert\ToJson` trait to an object, you can call `toJson` to convert the object to Json.

```
