grixu / socius-dto
Simple class for wrapping data with relations
Installs: 1 234
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 6
Requires
- php: ^8.0
- illuminate/support: ^9.0
- spatie/data-transfer-object: ^3.8
Requires (Dev)
- brainmaestro/composer-git-hooks: ^v3.0.0-alpha.1
- friendsofphp/php-cs-fixer: ^3.1
- illuminate/database: ^9.0
- nunomaduro/larastan: ^1.0.0
- nunomaduro/phpinsights: ^2.0
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.5
- spatie/x-ray: ^1.1
- dev-main
- 2.0.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/github_actions/shivammathur/setup-php-2.23.0
- dev-dependabot/github_actions/8398a7/action-slack-3.15.0
- dev-dependabot/github_actions/dependabot/fetch-metadata-1.3.5
- dev-dependabot/github_actions/actions/cache-3.0.11
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dependabot/composer/nunomaduro/larastan-tw-1.0.0or-tw-2.0.0
This package is auto-updated.
Last update: 2023-01-26 01:21:27 UTC
README
Simple class for wrapping data with relations.
Installation
You can install the package via composer:
composer require grixu/socius-dto
Usage
class YourDto extends \Grixu\SociusDto\SociusDto { // go forward as with normal DTO from spatie/data-transfer-object public string $some; } // Let's create one DTO object $dto = new YourDto([ 'some' => 'data', 'relations' => [ [ 'foreignModel' => ForeignModel::class, 'relation' => 'relationName', 'foreignField' => 'xl_id', 'type' => BelongsTo::class, 'foreignKeys' => 'id', ], ]);
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mateusz.gostanski@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.