compoships
compoships copied to clipboard
Multi-columns relationships for Laravel's Eloquent ORM
```php enum MyModelType: string { case .... class MyModel extends Model{ ... protected $casts = [ 'type' => MyModelType::class, ]; public function anotherModels(): HasMany { return $this->hasMany(AnotherModel::class, ['some_field', 'type'], ['some_field',...
I think there is a conflict with: [laravel-mysql-partition](https://github.com/lucabecchetti/laravel-mysql-partition) Is there any solution so I can work with both ?
I tried that package on laravel 10. But not running. i will see how used below picture    
Hi there, First of all thank you for having maintained the library for so long it has been great so far. Today I was trying to upgrade our Laravel to...
Hi, Guys. I am facing a problem, how can I make a relationship like the following? ```php function a() { return $this->hasMany(ModelRelated::class, ['employee_id', 'level_id'], ['employee_id', 'level_id']) ->where(function ($q) { $q->whereColumn('parent_table.start_date',...
Hi, Eloquent itself supports attach/detach/sync on many-to-many relationships. Is it possible to support those functions with multiple column keys? I briefly went through the code, they seem not supported for...
Future
Are there any plans to open a PR to Eloquent/Laravel?
I have a table exchanges that has standard_parcel_id and return_parcel_id. I want my Parcel model have an Exchange, so my relationship would be: ``` public function exchange(){ return $this->hasOne(Exchange::class, ['standard_parcel_id',...