neoban/backend/app/Http/Controllers/Chats/ChatController.php
kushal-saha 20a56d4adc refactor(core): replace SocialMediaService with GeneratePostService, add message fetching and JSON:API resources
- 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.
2026-04-30 09:00:14 +00:00

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'))
);
}
}