Laravel/Chat
-
3. View단 세팅Laravel/Chat 2021. 1. 17. 13:11
# What? 채팅창 UI 구현 # How? 1. 기본세팅 - 에코 추가 @ bootstrap.js import Echo from 'laravel-echo'; window.Pusher = require('pusher-js'); window.Echo = new Echo({ broadcaster: 'pusher', key: process.env.MIX_PUSHER_APP_KEY, cluster: process.env.MIX_PUSHER_APP_CLUSTER, forceTLS: true }); 2. UI 세팅
-
2. Pusher 세팅(채팅)Laravel/Chat 2021. 1. 16. 22:12
# What? 웹소켓 라이브러리 # How? * 주의사항 : laravel 8.29 미만에서 현재 에러남. 8.29 이상으로 세팅필요 1. 라이브러리 설치 npm install --save laravel-echo pusher-js composer require pusher/pusher-php-server composer require beyondcode/laravel-websockets php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="migrations" php artisan migrate php artisan vendor:publish --provider="BeyondC..
-
1. 기본 스키마 세팅Laravel/Chat 2021. 1. 15. 17:53
# What? - 채팅 구현을 위한 테이블 설계 # How? php artisan make:model -m Message php artisan make:model -m Chat php artisan make:resource UserResource php artisan make:resource MessageResource php artisan make:resource ChatResource php artisan make:resource UserCollection php artisan make:resource MessageCollection php artisan make:resource ChatCollection php artisan make:controller UserController php artisa..