Update Linking With ASO

This commit is contained in:
R
2023-02-17 14:29:50 +07:00
parent 912edcdae7
commit 5c71b556a0
10 changed files with 194 additions and 6 deletions

View File

@@ -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();
}
}