Save workspace changes

This commit is contained in:
2026-04-18 17:02:56 +02:00
parent f02ea9a711
commit 87d60af5a9
4220 changed files with 1388603 additions and 1554 deletions

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Story;
use App\Services\SocialService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
final class StoryInteractionController extends Controller
{
public function __construct(private readonly SocialService $social) {}
public function like(Request $request, int $storyId): JsonResponse
{
$story = Story::published()->findOrFail($storyId);
return response()->json(
$this->social->toggleStoryLike($request->user(), $story, $request->boolean('state', true))
);
}
public function bookmark(Request $request, int $storyId): JsonResponse
{
$story = Story::published()->findOrFail($storyId);
return response()->json(
$this->social->toggleStoryBookmark($request->user(), $story, $request->boolean('state', true))
);
}
}