*/ protected $fillable = [ 'user_id', 'telegram_user_id', 'bot_token', 'bot_username', 'chat_id', 'telegram_username', 'telegram_first_name', 'telegram_last_name', 'is_active', ]; /** @var array */ protected $casts = [ 'is_active' => 'boolean', ]; /** * Get the user associated with this telegram user. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Check if the user has a fully configured bot. */ public function isFullyConfigured(): bool { return !empty($this->bot_token) && !empty($this->chat_id); } }