From 932d439444f10774bff546923cc0a2e5e2f2857b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 20 Jul 2018 13:57:57 +0200 Subject: Rewrite (only for backend/oauth/api use from now on) --- app/Http/Controllers/SocketController.php | 44 ------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 app/Http/Controllers/SocketController.php (limited to 'app/Http/Controllers/SocketController.php') diff --git a/app/Http/Controllers/SocketController.php b/app/Http/Controllers/SocketController.php deleted file mode 100755 index dc95ad8..0000000 --- a/app/Http/Controllers/SocketController.php +++ /dev/null @@ -1,44 +0,0 @@ -on('messages.user_id', '=', 'users.id'); - }) - ->select('users.name', 'messages.message')->orderBy('messages.created_at') - ->get(); - - return view('writeMessage', compact('messages')); - } - - //Send Message - public function sendMessage(Request $request) - { - $user = Auth::user(); - - $input = $request->all(); - $redis = LRedis::connection(); - - if (!isset($input['message']) || trim($input['message']) === '') { - } else { - Message::create([ - 'user_id' => $user->id, - 'message' => $input['message'], - ]); - - $data = ['message' => $input['message'], 'user' => $user->name]; - $redis->publish('message', json_encode($data)); - } - } -} -- cgit v1.2.3