> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crunchz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Channel

> Methods for managing and interacting with communication channels

## Overview

The Channel module provides functionality to manage communication channels, check their health status, verify phone numbers, and send messages. This module is essential for ensuring reliable communication with your users.

## Available Methods

### Health Check

Use the `health()` method to verify if the communication channel is operational and functioning correctly.

```php theme={null}
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->health();
```

<Note>
  It's recommended to perform health checks regularly to ensure your communication channels are working properly.
</Note>

### Phone Number Verification

The `checkPhoneNumber()` method allows you to validate if a phone number exists and is properly formatted.

<Tabs>
  <Tab title="Basic Usage">
    ```php theme={null}
    use CrunchzApp\CrunchzApp;

    CrunchzApp::channel()
      ->checkPhoneNumber('628xxxxx');
    ```

    This performs a standard verification of the provided phone number.
  </Tab>

  <Tab title="Parameters">
    | Parameter   | Type    | Required | Description                                      |
    | ----------- | ------- | -------- | ------------------------------------------------ |
    | phoneNumber | string  | Yes      | The phone number to verify (with country code)   |
    | parallel    | boolean | No       | Whether to run in parallel mode (default: false) |
  </Tab>
</Tabs>

### Parallel Processing

For more complex operations, you can use parallel processing to check phone numbers while performing other actions simultaneously.

```php theme={null}
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->checkPhoneNumber('628xxxxx', true)
  ->startTyping()
  ->text('Hi there')
  ->stopTyping()
  ->send();
```

<Warning>
  When using parallel mode, make sure to call the `send()` method at the end to execute all queued operations.
</Warning>

## Common Use Cases

<AccordionGroup>
  <Accordion title="Verifying User Phone Numbers">
    Use the `checkPhoneNumber()` method during user registration to ensure valid phone numbers.
  </Accordion>

  <Accordion title="Monitoring Channel Health">
    Implement regular health checks in your application's monitoring system.
  </Accordion>

  <Accordion title="Interactive Messaging">
    Use parallel processing to create more engaging user experiences with typing indicators.
  </Accordion>
</AccordionGroup>
