Update Linking With ASO
This commit is contained in:
@@ -31,4 +31,17 @@ class MemberPlan extends Model
|
||||
{
|
||||
return $this->belongsTo(CorporatePlan::class, 'plan_id', 'code');
|
||||
}
|
||||
|
||||
public function plan()
|
||||
{
|
||||
return $this->belongsTo(Plan::class, 'plan_id');
|
||||
}
|
||||
|
||||
public function scopeActive($q)
|
||||
{
|
||||
return $q
|
||||
->where('start', '<', now())
|
||||
->where('end', '>', now())
|
||||
->latest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user