belongsTo(Dharma::class, 'dharma_id'); } /** * @return mixed */ public function sampraday() { return $this->belongsTo(Sampraday::class, 'sampraday_id'); } /** * Get the sant followers. */ public function followers() { return $this->belongsToMany(User::class, 'sangh_followers', 'sangh_id', 'user_id')->withTimestamps(); } /** * Get the sant followings. */ public function followings() { return $this->belongsToMany(User::class, 'sangh_followers', 'user_id', 'sangh_id')->withTimestamps(); } /** * Get the sant followings. */ public function sanghMembers() { return $this->belongsToMany(User::class, 'sangh_members', 'sangh_id', 'user_id')->withTimestamps()->withPivot('core_committee', 'role', 'status', 'is_owner'); } /** * @return mixed */ public function createdBy() { return $this->belongsTo(User::class, 'created_by', 'id'); } /** * @return mixed */ public function updatedBy() { return $this->belongsTo(User::class, 'updated_by', 'id'); } /** * add points for for registration. */ public function addPoints() { return $this->morphMany(KarmaPointsTransaction::class, 'pointable'); } public function user() { $this->belongsTo(User::class, 'user_id'); } }