- 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.
24 lines
526 B
PHP
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,
|
|
];
|
|
}
|
|
}
|