compoships icon indicating copy to clipboard operation
compoships copied to clipboard

Multi-columns relationships for Laravel's Eloquent ORM

Results 32 compoships issues
Sort by recently updated
recently updated
newest added

```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 ![image 1](https://github.com/topclaudy/compoships/assets/7147727/8e48fce3-c26e-4c4c-9bf3-fb0e760b573a) ![image 2](https://github.com/topclaudy/compoships/assets/7147727/d8d780f9-b80a-4b13-9f86-3f3959df9fbd) ![table schema](https://github.com/topclaudy/compoships/assets/7147727/a8ba6c68-0831-4e98-852e-858ab63ff28b) ![image 3](https://github.com/topclaudy/compoships/assets/7147727/24bf2fe8-865d-4a48-920c-45c53e336f4e)

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...

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',...