- Moved chat-related controllers, resources, requests, and DTOs into their respective `Chats` namespaces. - Updated route imports to reflect new namespace structure.
17 lines
308 B
PHP
17 lines
308 B
PHP
<?php
|
|
|
|
namespace App\Actions\Chats;
|
|
|
|
use App\Data\Chats\ChatResponseDto;
|
|
use App\Models\User;
|
|
|
|
class CreateChatAction
|
|
{
|
|
public function create(User $user, ?string $title = null)
|
|
{
|
|
$chat = $user->chats()->create(['title' => $title]);
|
|
|
|
return ChatResponseDto::fromModel($chat);
|
|
}
|
|
}
|