Download the PHP package sheldonreiff/laravel-advanced-relationships without Composer
On this page you can find all versions of the php package sheldonreiff/laravel-advanced-relationships. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sheldonreiff/laravel-advanced-relationships
More information about sheldonreiff/laravel-advanced-relationships
Files in sheldonreiff/laravel-advanced-relationships
Package laravel-advanced-relationships
Short Description Multi-column and JSON relationships using awobaz/compoships and staudenmeir/eloquent-json-relations
License MIT
Informations about the package laravel-advanced-relationships
Laravel Advanced Relationships
Multi-column and JSON-column relationships for Laravel Eloquent using awobaz/compoships and staudenmeir/eloquent-json-relations
In a recent project, I've encountered the need to use both multi-column and JSON-column relationships in the same model. Neither functionality is supported natively by Laravel. Two third-party packages exist that provide these functionalities separately, however, they have several conflicting methods so they can't be used together in the same class. This package combines awobaz/compoships and staudenmeir/eloquent-json-relations to provide full functionality of both in the same Laravel model.
Installation
Usage
Add the HasAdvancedRelationships
trait to both the parent and the related model. For all of the supported relationships, either a JSON column, multiple columns, or multiple JSON columns may be specified for the local and foreign keys as seen in the example below.
Supported relationships
Both multi-column and JSON-column support are provided for the following relationships.
- hasOne
- hasMany
- belongsTo
Additional information
Refer to awobaz/compoships and staudenmeir/eloquent-json-relations for additional functionality and other information. This package depends on these packages and simply implements the necessary integrations to make them work together.
All versions of laravel-advanced-relationships with dependencies
awobaz/compoships Version ^1.1
staudenmeir/eloquent-json-relations Version ^1.2.3