I have the a scope function for my user table (User.php):
public function scopeWherePaidSubscriber(Builder $query)
{
return $query->where(....)->where(...);
}
I am trying to access this scope from a subquery looking like this:
$count = UserCalendar::whereIn('user_id', function($que) use ($cid) {
$que->select('id')->from('user')->where('corporation_id', $cid)->wherePaidSubscriber();
})->distinct('user_id')->count();
But then I noticed than I couldn’t access the scope because I am not using User::wherePaidSubscriber().
Is there a way for me to access the scope without having to copy paste it?