grixu/socius-dto

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple class for wrapping data with relations

Maintainers

Package info

github.com/grixu/socius-dto

pkg:composer/grixu/socius-dto

Statistics

Installs: 1 253

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 6


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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.