Open Daniel-Monroy opened 11 months ago
Hi, Guys.
I am facing a problem, how can I make a relationship like the following?
function a() { return $this->hasMany(ModelRelated::class, ['employee_id', 'level_id'], ['employee_id', 'level_id']) ->where(function ($q) { $q->whereColumn('parent_table.start_date', '<=', 'related_table.start_date') ->whereColumn('parent_table.end_date', '>=', 'related_table.end_date'); }); }
That's not how things work
Hi, Guys.
I am facing a problem, how can I make a relationship like the following?