I have a 3 tables which have the following relationships:
Events Table:
public function modalitys()
{
return $this->hasMany('Deportes\Models\Modality', 'events_id');
}
Modality Table:
public function discounts()
{
return $this->hasMany('Deportes\Models\Discount', 'modalitys_id');
}
public function event()
{
return $this->belongsTo('Deportes\Models\Event');
}
table discount:
public function modality()
{
return $this->belongsTo('Deportes\Models\Modality');
}
Is there a laravel method to edit modalities and discounts with eloquent, as well as sync and detach for 1 to 1 relations?