This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [...] | |
Route::post('/get-or-create-channel', 'ChatController@createOrGetChannel'); | |
// [...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [...] | |
Route::get('/get-users', 'ChatController@getUsers'); | |
// [...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [...] | |
/** | |
* Get all users | |
*/ | |
public function getUsers(Request $request) | |
{ | |
return response()->json([ | |
'users' => User::all() | |
], 200); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::post('/generate-token', 'ChatController@getnerateToken'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use GetStream\StreamChat\Client as StreamClient; | |
use App\User; | |
use App\Channel; | |
use Illuminate\Support\Facades\Auth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* [...] */ | |
input[type="text"] { | |
padding: 10px 8px; | |
margin-top: 10px; | |
border-radius: 2px; | |
border: 1px solid darkgray; | |
font-size: 16px; | |
box-sizing: border-box; | |
display: block; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="active-chats row"> | |
<message-component | |
v-for="chat in activeChats" | |
:key="chat.id" | |
:token="token" | |
:client="client" | |
:chat="chat" | |
:autheduser="autheduser"> | |
</message-component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="card user-box"> | |
<div class="card-header" @click="collapsed = !collapsed"> | |
{{ chat.name }} | |
</div> | |
<div class="card-body" v-show="!collapsed"> | |
<div class="user-messages"> | |
<div | |
class="chat-message" | |
v-for="message in messages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="card users-box"> | |
<div class="card-header" @click="collapsed = !collapsed"> | |
Users | |
</div> | |
<div class="card-body users" v-show="!collapsed"> | |
<div class="user" v-for="user in users" :key="user.id" @click="addToActiveChat(user)"> | |
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQSXmfj4kUOZR1oT7ood5_AqnC_TgkuyVojx73oE2eYdp4Mvl29" width="30" height="30"> | |
{{ user.name }} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="stream-chat row"> | |
<active-chats-component :autheduser="autheduser"></active-chats-component> | |
<users-component></users-component> | |
</div> | |
</template> | |
<script> | |
export default { | |
props: ['autheduser'], |