neoban/backend/app/Http/Resources/Chats/ChatCollection.php
kushal-saha ad0f0bf67b feature(chat): implement sidebar, chat listing, and improved chat handling
- Added `Sidebar` component with responsive layout for chat navigation.
- Implemented `ChatStore` for managing chat data and fetching user chats.
- Integrated JSON:API `ChatCollection` for consistent backend responses.
- Added `GetUserChatsAction` to retrieve paginated user chats.
- Refactored frontend to separate `ChatStore` and `MessageStore` for improved state management.
- Updated styles, components, and tests for seamless chat interactions.
2026-04-30 13:06:47 +00:00

24 lines
526 B
PHP

<?php
namespace App\Http\Resources\Chats;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Attributes\Collects;
use Illuminate\Http\Resources\Json\ResourceCollection;
#[Collects(ChatResponseResource::class)]
class ChatCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @return array<int|string, mixed>
*/
public function toArray(Request $request): array
{
return [
'data' => $this->collection,
];
}
}