mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-03-15 01:20:44 -05:00
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE.
|
|
*
|
|
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D
|
|
*
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author Poppabear
|
|
*/
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ChatUserResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
*
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'username' => $this->username,
|
|
'chat_status' => $this->whenLoaded('chatStatus'),
|
|
'chat_status_id' => $this->chat_status_id,
|
|
'chatroom_id' => $this->chatroom_id,
|
|
'group' => $this->whenLoaded('group'),
|
|
'echoes' => $this->whenLoaded('echoes'),
|
|
'group_id' => $this->group_id,
|
|
'title' => $this->title,
|
|
'image' => $this->image,
|
|
];
|
|
}
|
|
}
|