Download the PHP package lastdragon-ru/lara-asp-serializer without Composer
On this page you can find all versions of the php package lastdragon-ru/lara-asp-serializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lastdragon-ru/lara-asp-serializer
More information about lastdragon-ru/lara-asp-serializer
Files in lastdragon-ru/lara-asp-serializer
Package lara-asp-serializer
Short Description Provides a customizable wrapper around the Symfony Serializer Component to use it inside Laravel application.
License MIT
Homepage https://github.com/LastDragon-ru/php-packages
Informations about the package lara-asp-serializer
(Laravel) Symfony Serializer
This package provides a customizable wrapper around the Symfony Serializer Component to use it inside Laravel application.
[include:artisan]: <lara-asp-documentator:requirements "{$directory}">
Requirements
| Requirement | Constraint | Supported by |
|---|---|---|
| PHP | ^8.5 |
HEAD ⋯ 11.0.0 |
^8.4 |
HEAD ⋯ 8.0.0 |
|
^8.3 |
10.3.0 ⋯ 5.0.0 |
|
^8.2 |
7.2.0 ⋯ 5.0.0-beta.0 |
|
^8.1 |
6.4.2 ⋯ 5.0.0-beta.0 |
|
| Laravel | ^13.10.0 |
HEAD ⋯ 11.1.0 |
^13.0.0 |
11.0.0 |
|
^12.0.1 |
10.3.0 ⋯ 9.0.0 |
|
^11.0.8 |
8.1.1 ⋯ 8.0.0 |
|
^11.0.0 |
7.2.0 ⋯ 6.2.0 |
|
^10.34.0 |
7.2.0 ⋯ 6.2.0 |
|
^10.0.0 |
6.1.0 ⋯ 5.0.0-beta.0 |
|
^9.21.0 |
5.6.0 ⋯ 5.0.0-beta.1 |
|
^9.0.0 |
5.0.0-beta.0 |
Installation
Usage
The $serialized is:
The $deserialized is:
Partial deserialization
Sometimes you don't know (or do not want to support) the full structure of the object. In this case you can mark the class as Partial to allow unserialize only known (wanted) properties:
The $deserialized is:
Extending
Out of the box, the package supports only the following objects (see Factory for more details):
- Any object that implement
SerializableNormalizer) - Any object that implement
\DateTimeInterface(seeDateTimeNormalizer) \DateTimeZone\DateInterval- PHP Enums
Publish the config and add normalizers/denormalizers if you need more:
Eloquent Accessor/Mutator^1
You can use the Serialized attribute to populate a model attribute to/from an object:
The $user->settings is:
The $user->getAttributes() is:
Upgrading
Please follow Upgrade Guide.
Contributing
Please use the main repository to report issues, send pull requests, or ask questions.
"\LastDragon_ru\LaraASP\Serializer\Casts\Serialized"
"\LastDragon_ru\LaraASP\Serializer\Contracts\Partial"All versions of lara-asp-serializer with dependencies
illuminate/contracts Version ^13.10.0
illuminate/database Version ^13.10.0
illuminate/support Version ^13.10.0
lastdragon-ru/lara-asp-core Version self.version
lastdragon-ru/path Version self.version
phpdocumentor/type-resolver Version ^1.10.0|^2.0.0
phpstan/phpdoc-parser Version ^2.0.0
symfony/property-access Version ^8.0.0
symfony/property-info Version ^8.0.0
symfony/serializer Version ^8.0.0
symfony/type-info Version ^8.0.0