Change Benefit Table Structure
This commit is contained in:
@@ -168,6 +168,15 @@ class Plan extends Model
|
||||
|
||||
public function benefits()
|
||||
{
|
||||
return $this->hasMany(Benefit::class, 'plan_code', 'id');
|
||||
return $this->belongsToMany(Benefit::class, 'corporate_benefits', 'benefit_id', 'id')
|
||||
->withTimestamps()
|
||||
->withPivot([
|
||||
// TODO corporate_benefits pivot
|
||||
]);
|
||||
}
|
||||
|
||||
public function corporateBeneftis()
|
||||
{
|
||||
return $this->hasMany(CorporateBenefit::class, 'benefit_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user