belongsTo(Thread::class, 'thread_uuid', 'uuid'); } /** * @return BelongsToMany */ public function groups(): BelongsToMany { return $this->belongsToMany(Group::class, 'posts_has_groups', 'post_uuid', 'group_uuid'); } /** * @return BelongsToMany */ public function users(): BelongsToMany { return $this->belongsTomany(User::class, 'posts_has_users', 'post_uuid', 'user_uuid'); } /** * @return BelongsToMany */ public function files(): BelongsToMany { return $this->belongsTomany(Userfile::class, 'posts_has_users_files', 'post_uuid', 'userfile_uuid'); } }