compare two arrays Laravel
问题 I have articles that can contain different tags. For example, 5 pieces: (php, html, css, laravel, js) And I have groups that can also contain different tags. For example 4 pieces: (laravel, php, html, css) I have already defined the relationships and it works. What I still lack is the linkage of article to the group. In the Articlecontroller i use this so sync: $article->groups()->sync($group->id); Article Model public function groups() { return $this->belongsToMany('App\Group'); } public