- Updated `Chat` and `ChatMessage` models for new table structures with UUIDs and attributes. - Integrated `ChatPolicy` for authorization checks. - Updated `ChatMessageController` with authorization and refined logic. - Adjusted routes and state in the frontend to handle chat IDs from the URL. - Enhanced `SocialMediaService` for handling chat-specific user prompts. - Removed unused migrations related to chats and chat messages.
21 lines
528 B
PHP
21 lines
528 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Actions\Chats\CreateChatAction;
|
|
use App\Http\Requests\CreateChatRequest;
|
|
use App\Http\Resources\ChatResponseResource;
|
|
use App\Models\Chat;
|
|
|
|
class ChatController extends Controller
|
|
{
|
|
public function index(Request $request) {}
|
|
|
|
public function store(CreateChatRequest $request, CreateChatAction $createChatAction)
|
|
{
|
|
return new ChatResponseResource(
|
|
$createChatAction->create($request->user(), $request->input('title', 'New Chat'))
|
|
);
|
|
}
|
|
}
|