- Removed `SocialMediaService` and migrated core post generation logic to `GeneratePostService`. - Added `GetAllChatMessagesAction` for fetching chat history. - Introduced `MessageDto`, `MessageResource`, and `MessageCollection` for consistent backend API responses. - Updated frontend state and services to support JSON:API-compliant chat messages and history retrieval. - Improved typings and casting for chat message data.
22 lines
577 B
PHP
22 lines
577 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Chats;
|
|
|
|
use App\Actions\Chats\CreateChatAction;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Chats\CreateChatRequest;
|
|
use App\Http\Resources\Chats\ChatResponseResource;
|
|
use App\Models\Chat;
|
|
|
|
class ChatController extends Controller
|
|
{
|
|
public function index(Chat $chat) {}
|
|
|
|
public function store(CreateChatRequest $request, CreateChatAction $createChatAction)
|
|
{
|
|
return new ChatResponseResource(
|
|
$createChatAction->create($request->user(), $request->input('title', 'New Chat'))
|
|
);
|
|
}
|
|
}
|