Menu

## ConversationList extends Component
in package

ConversationList.php : 23

Class ConversationList

Livewire component responsible for displaying and dynamically updating the list of conversations for the authenticated user.

This component handles:

- Initial conversation list injection
- Listening for real-time conversation creation events
- Prepending new conversations to the list

### Table of Contents

#### Properties

$conversations : Collection
  Collection of conversations.

#### Methods

getListeners() : array<string|int, mixed>
  Register Livewire event listeners.
mount() : void
  Lifecycle hook executed when the component is mounted.
prependConversation() : void
  Prepend a conversation to the conversation list.
prependConversationFromBroadcast() : void
  Handle conversation creation event broadcast.
render() : View
  Render the Livewire component view.

### Properties

#### $conversations

ConversationList.php : 30

Collection of conversations.

`public Collection $conversations`

### Methods

#### getListeners()

ConversationList.php : 54

Register Livewire event listeners.

`public getListeners() : array<string|int, mixed>`

Listens for broadcasted conversation creation events on the authenticated user's private channel.

##### Return values

array<string|int, mixed>

#### mount()

ConversationList.php : 41

Lifecycle hook executed when the component is mounted.

`public mount(Collection $conversations) : void`

Injects the initial conversation collection into the component.

##### Parameters

$conversations : Collection

#### prependConversation()

ConversationList.php : 71

Prepend a conversation to the conversation list.

`public prependConversation(int|string $id) : void`

Fetches the conversation by ID and adds it to the beginning of the collection.

##### Parameters

$id : int|string

  Conversation ID

#### prependConversationFromBroadcast()

ConversationList.php : 85

Handle conversation creation event broadcast.

`public prependConversationFromBroadcast(array<string|int, mixed> $payload) : void`

Extracts conversation ID from the payload and prepends the conversation to the list.

##### Parameters

$payload : array<string|int, mixed>

  Broadcast event payload

#### render()

ConversationList.php : 97

Render the Livewire component view.

`public render() : View`

Displays the conversation list.

##### Return values

View

## Search results