Menu

## ConversationCreate extends Component
in package

ConversationCreate.php : 25

Class ConversationCreate

Livewire component responsible for creating a new conversation and sending the first message.

This component handles:

- Selecting users for the conversation
- Creating a conversation record
- Creating the initial message
- Attaching users to the conversation
- Broadcasting the conversation creation event

### Table of Contents

#### Properties

$body : string
  Initial message body for the conversation.
$users : array<string|int, mixed>
  List of selected users for the conversation.

#### Methods

addUser() : void
  Add a user to the conversation participant list.
collectUserIds() : Collection
  Collect unique user IDs for the conversation.
create() : RedirectResponse
  Create a new conversation.
render() : View
  Render the Livewire component view.

### Properties

#### $body

ConversationCreate.php : 39

Initial message body for the conversation.

`public string $body = ''`

#### $users

ConversationCreate.php : 32

List of selected users for the conversation.

`public array<string|int, mixed> $users = []`

### Methods

#### addUser()

ConversationCreate.php : 47

Add a user to the conversation participant list.

`public addUser(mixed $user) : void`

##### Parameters

$user : mixed

  User model or user data

#### collectUserIds()

ConversationCreate.php : 92

Collect unique user IDs for the conversation.

`public collectUserIds() : Collection`

Merges selected users with the authenticated user and returns a unique list of user IDs.

##### Return values

Collection

#### create()

ConversationCreate.php : 61

Create a new conversation.

`public create() : RedirectResponse`

Validates input data, creates a conversation record, sends the initial message, attaches users, broadcasts the creation event, and redirects to the conversation view.

##### Return values

RedirectResponse

#### render()

ConversationCreate.php : 107

Render the Livewire component view.

`public render() : View`

Displays the conversation creation form.

##### Return values

View

## Search results