Загрузка...

#70 Dating/Social Networking in Laravel 5.8 | Integrate Live Chat Box (V)

In Part-70 of dating series, we will continue working on integrating chat box for users with Laravel, Ajax and jQuery. In this video, we will continue working on the functionality of the chat box.

1) Update chat.js file :-
We will update chat.js file with pullData function which will again call two other functions retrieveChatMessages and retrieveTypingStatus that we will define in chat.js file as well and will execute every 3 seconds.

And pullData function we will call in the beginning of the script in chat.js file within ready function.

Now we will define retrieveChatMessages and retrieveTypingStatus functions in chat.js file.

2) Create Routes for retrieveChatMessages and retrieveTypingStatus in web.php file with username parameter like below :-

Route::post('/chat/retrieveChatMessages', 'ChatController@retrieveChatMessages');
Route::post('/chat/retrieveTypingStatus', 'ChatController@retrieveTypingStatus');

3) Create retrieveChatMessages and retrieveTypingStatus functions in ChatController :-
We will create retrieveChatMessages and retrieveTypingStatus functions in ChatController.

4) Update chat.blade.php file :-
Now we will update chat.blade.php file and call notTyping function

5) Update VerifyCsrfToken.php file :-
Update VerifyCsrfToken.php file to add chat routes so that 419 CSRF token error will not come.

"chat/sendMessage","chat/isTyping","chat/notTyping","chat/retrieveChatMessages","chat/retrieveTypingStatus","chat"

6) Update front_sidebar.blade.php file :-
We will update front_sidebar.blade.php file to show Live Chat Room that we have just created and will show only if user is login and having dating profile.

We can also make a check like if you try to do live chatting with any other user then website will not allow it.

Thanks for watching :)

Видео #70 Dating/Social Networking in Laravel 5.8 | Integrate Live Chat Box (V) канала Stack Developers
Яндекс.Метрика

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять