Implement Authentication States, show logout options in auth store and services. Make DB and controllers to make messages grouped by chats. Refactor backend code to use DTO.
20 lines
518 B
PHP
20 lines
518 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Http\Requests\GeneratePostRequest;
|
|
use App\Http\Resources\GeneratedPostResource;
|
|
use App\Models\Chat;
|
|
use App\Services\SocialMediaService;
|
|
|
|
class ChatMessageController extends Controller
|
|
{
|
|
public function store(GeneratePostRequest $request, Chat $chat, SocialMediaService $socialMediaService)
|
|
{
|
|
return new GeneratedPostResource(
|
|
$socialMediaService
|
|
->generatePostWithImage($request->input('prompt'), $chat)
|
|
);
|
|
}
|
|
}
|