2017 © Pedro Peláez
 

library laravel-serializer

An integration of JMS Serializer with Laravel!

image

psychob/laravel-serializer

An integration of JMS Serializer with Laravel!

  • Wednesday, May 23, 2018
  • by psychob
  • Repository
  • 1 Watchers
  • 0 Stars
  • 164 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 7 Versions
  • 8100 % Grown

The README.md

Laravel Serializer

Binds the JMS serializer library to Laravel and allows schemas to be defined according to normal Laravel configuration conventions., (*1)

Setup

To get Laravel Serializer ready for use in your project, take the usual steps for setting up a Laravel package., (*2)

  1. Run: composer require psychob/laravel-serializer
  2. Add to your service provider: Atrauzzi\LaravelSerializer\JMSSerializerServiceProvider::class
  3. Run php artisan vendor:publish
Note: Because this package does not perform any data storage, no migrations are required.

Configuring

All configuration is stored in config/serializer.php., (*3)

<?php
    return [
        // Auto fetch properties which are:
        //  * public - public properties (which can be accessed with getter)
        //  * static - static properties (which can be accessed with getter)
        // If default visibility is not set, or it's empty, only attributes
        // list will be used. If it's set, attributes will be considered
        // first, and then properties with default visibility will be
        // added
        'default_visibility' => [],

        // Add to serializer output _type property with class name
        'meta_property' => false,

        'mappings' => [
            Type::class => [
                'default_visibility' => [],
                'meta_property' => false,

                // You can map attributes in 3 ways:
                //  * listing them by name
                //  * listing them by name, and forcing correct
                //    serialization type
                //  * listring them by name and setting other options:
                //     * name - serialized name
                //     * type - serialization type
                //     * groups - list of groups
                'attributes' => [
                    'simple_property',
                    'typed_property' => 'string',
                    'complex_property' => [
                        'type' => 'string',
                        'name' => 'custom_name',
                        'groups' => ['group'],
                    ],
                ],
            ]
        ],
    ];

Credits

This library is maintained by Andrzej Budzanowski, based on atrauzzi/laravel-serializer by Alexander Trauzzi, (*4)

The Versions

23/05 2018

dev-master

9999999-dev

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block
by Andrzej Budzanowski

laravel serializer

23/05 2018

1.3.1

1.3.1.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block
by Andrzej Budzanowski

laravel serializer

23/05 2018

1.3

1.3.0.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block
by Andrzej Budzanowski

laravel serializer

23/05 2018

1.2

1.2.0.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block
by Andrzej Budzanowski

laravel serializer

15/05 2018

1.1

1.1.0.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block
by Andrzej Budzanowski

laravel serializer

21/11 2017

1.0.1

1.0.1.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

by David Block

laravel serializer

18/05 2016

1.0.0

1.0.0.0

An integration of JMS Serializer with Laravel!

  Sources   Download

MIT

The Requires

 

laravel serializer