laravel-eloquent-compound-keys maintained by sebwas
Description
This helps using eloquent when using compound keys in the database
Author
Last update
2016/06/17 17:23
(dev-master)
License
Downloads
70
Laravel Eloquent compound keys support
Usage
In your Model that uses the compound keys, simply put use SebWas\Laravel\Eloquent\CompoundKeys;.
If another Model is referencing this through a HasManyThrough relationship, use the SebWas\Laravel\Eloquent\CompoundKeysRelationship trait with it.
Limits
There are a few limits to this, that can be solved by overriding the functions and re-implementing them properly.
- The static
destroycan't be called - The
morphTorelationship won't work - HasManyThrough's
getHasCompareKeydoesn't work - Some other functions, especially on relations may be buggy