Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where not working #162

Open
Daniel-Monroy opened this issue Sep 18, 2023 · 1 comment
Open

Where not working #162

Daniel-Monroy opened this issue Sep 18, 2023 · 1 comment

Comments

@Daniel-Monroy
Copy link

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');
        });
}
@parallels999
Copy link

That's not how things work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants