r-quintin/extended-relations

1.1.0 2023-11-05 11:03 UTC

This package is auto-updated.

Last update: 2024-09-05 13:02:56 UTC


README

Latest Stable Version License

The ExtendedRelations package for Laravel made relations for you and loads it automatically in array serialization.

Installation

$ composer require r-quintin/extended-relations

Simple usage

use RQuintin\ExtendedRelations\ExtendedModel;

class Driver extends ExtendedModel
{
  /**
   * Relations on this model
   *
   * @var string|string[]|null
   */
    protected string|array|null $relationships = ['vehicles'];

  /**
   * Loaded relations in serialization
   *
   * @var string|array|null
   */
    protected string|array|null $loads = ['vehicles'];
}

Documentation

For setup, usage guidance, and all other docs - please consult the Project Wiki.

License

ExtendedRelations is open-sourced software licensed under the MIT license.