created_at->diffForHumans(); } /** * Returns model in days since updated_at. */ public function getUpdatedAgoAttribute() { if ($this->updated_at) { return $this->updated_at->diffForHumans(); } else { return Constant::NULL; } } /** * Get all of the thana that belong to the chaturmas. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function viharThana() { return $this->belongsToMany(Sant::class, 'vihar_thanas') ->withTimestamps(); } /** * add points for for registration. */ public function addPoints() { return $this->morphMany(KarmaPointsTransaction::class, 'pointable'); } /** * Returns model in days since created_at. */ public function getIsOwnerAttribute() { $user = loggedInUser(); if ($user){ return $this->created_by == $user->id; } } }