public function getAuthorAttribute()
    {
        return (object) [
            'name' => is_int($this->user_id) ? $this->user->name : $this->name,
            'profile' => is_int($this->user_id) ? $this->user->profile : $this->name,
            'avatar' => is_int($this->user_id) ? $this->user->avatar : get_avatar($this->email),
            'isOnline' => is_int($this->user_id) ? $this->user->isOnline() : false,
        ];
    }
public function getAuthorAttribute()
    {
        return (object) [
            'name' => is_int($this->user_id) ? $this->user->name : $this->name,
            'profile' => is_int($this->user_id) ? $this->user->profile : $this->name,
            'avatar' => is_int($this->user_id) ? $this->user->avatar : get_avatar($this->email),
            'isOnline' => is_int($this->user_id) ? $this->user->isOnline() : false,
        ];
    }
public function getAuthorAttribute ( ) { return ( object ) [ 'name' => is_int ( $ this -> user_id ) ? $ this -> user -> name : $ this -> name , 'profile' => is_int ( $ this -> user_id ) ? $ this -> user -> profile : $ this -> name , 'avatar' => is_int ( $ this -> user_id ) ? $ this -> user -> avatar : get_avatar ( $ this -> email ) , 'isOnline' => is_int ( $ this -> user_id ) ? $ this -> user -> isOnline ( ) : false , ] ; }
Don't touch this. Need when comments added from ajax
Don t touch this . Need when comments added from ajax