ClanCats/Hydrahon

WhereOr access in function

Closed this issue · 3 comments

Good night,

How i can get variable from function where.
Example:

where(function($q) {
$q->where('start','>=',$variable1)->orWhere('end','<=',$variable2);
});

Hello

Im not 100% sure I understand the question correctly.

but if you mean to get the variables into the where scope you can just use them.

->where(function($q) use($variable1, $variable2) {
    $q->where('start', '>=', $variable1)->orWhere('end','<=',$variable2);
});

Im closing this Issue now. Let me know if the issue persists.

Its works

Thanksssss