New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

grixu/socius-dto

Simple class for wrapping data with relations
1,288
Install
composer require grixu/socius-dto
Latest Version:3.0.0
PHP:^8.1
Laravel:10 – 13
Older releases:8 · 9
License:MIT
Last Updated:Oct 12, 2026
Links: GitHub  ·  Packagist
Maintainer: grixu

socius-dto

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.

Related Packages

grixu/socius-models

Models for Socius API and all apps using Socius which need to keep local copy of...

1,835 0
grixu/data-factories

Simple DTOs factories

1,798 0
grixu/synchronizer

Tools for sync data from DTO (foreign system) to local DB

1,492 0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982

Version History

Version Released PHP Laravel License
3.0.0 ^8.1 ^10.0|^11.0|^12.0|^13.0 MIT
2.0.0 ^8.0 ^9.0 MIT
1.2.2 ^8.0 ^8.0 MIT
1.2.1 ^8.0 ^8.0 MIT
1.2.0 ^8.0 ^8.0 MIT