public function tags() { return $this->belongsToMany('App\\Models\\Tag', 'post_tag', 'post_id'); }
/** * Destroy a post. * * @param App\Models\Post $post * @return void */ public function destroy($post) { $post->tags()->detach(); $post->delete(); }