calling groupBy on the belongsToMany should work
return $this->belongsToMany('App\RecursoWeb', 'producto_recurso_web', 'producto_id', 'recurso_web_id')->groupBy('producto_id');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community