createorupdate hasmany relationship laravel code example
Example: laravel update or create wioth hasmany relation
class Item extends Model
{
protected $fillable = ['menu_id', 'parent_id', 'title', 'order', 'resource_link', 'html_class', 'is_blank'];
public function translations()
{
return $this->hasMany(MenuItemTranslation::class, 'menu_item_id');
}
}