belongsTo(Team::class); } /* ATTRIBUTES */ /** * Return if the user is allowed to use this bot * * @return bool */ public function getIsAllowedAttribute(): bool { return $this->active; } /** * Return the channel name * * @return string */ public function getNameAttribute(): string { return Arr::get($this->attributes,'name') ?: $this->channel_id; } /* METHODS */ /** * Is this channel a direct message channel? * * @return bool */ public function isDirect(): bool { return preg_match('/^D/',$this->channel_id) OR $this->name == 'directmessage'; } }