Download the PHP package yonchando/laravel-cast-attributes without Composer
On this page you can find all versions of the php package yonchando/laravel-cast-attributes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yonchando/laravel-cast-attributes
More information about yonchando/laravel-cast-attributes
Files in yonchando/laravel-cast-attributes
Package laravel-cast-attributes
Short Description Laravel model cast json columns to class object
License MIT
Homepage https://github.com/yonchando/laravel-cast-attributes
Informations about the package laravel-cast-attributes
Laravel Cast Attribute
Laravel cast attribute is model custom cast json column to Class entity
IMPORTANT property is not primitive (User-Define Type), The User-Define type need to have default value to property.
Installation
Via Composer
Usage
Model
UserJson
private property must have setter with camelCase start with
set
Image
For sub property class use trait
CastProperty
Controller
Methods available for CastProperty trait
Name | modifier | parameters | Description |
---|---|---|---|
toArray | public | class property to array | |
toJson | public | int $options | class property to json_encode string |
create | public static | array|object $data | initialize class |
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Author Name
- All Contributors
License
MIT. Please see the license file for more information.
All versions of laravel-cast-attributes with dependencies
laravel/framework Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/container Version ^8.12|^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^8.12|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^8.12|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0