Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
<<<<<<< HEAD
=======
use App\User;

use Nahid\Talk\Live\Broadcast;
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

class HomeController extends Controller
{
Expand All @@ -26,6 +29,9 @@ public function __construct()
*/
public function index()
{
<<<<<<< HEAD
return view('home');
=======
$users = User::all();
return view('home', compact('users'));
}
Expand All @@ -35,5 +41,6 @@ public function tests()

$b = new Broadcast(\Illuminate\Contracts\Config\Repository::class, \Vinkla\Pusher\PusherFactory::class);
dd($b->tests());
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
}
}
11 changes: 11 additions & 0 deletions app/Http/Controllers/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,15 @@ public function tests()
{
dd(Talk::channel());
}
<<<<<<< HEAD

public function index()
{
$users = User::all();
return view('/home', compact('users'));
}

}
=======
}
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
20 changes: 20 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
| any other location as required by the application or its packages.
*/

<<<<<<< HEAD
'name' => 'Test Chat 123',
=======
'name' => 'Talk Message',
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

/*
|--------------------------------------------------------------------------
Expand All @@ -38,7 +42,11 @@
|
*/

<<<<<<< HEAD
'debug' => env('APP_DEBUG', true),
=======
'debug' => env('APP_DEBUG', false),
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

/*
|--------------------------------------------------------------------------
Expand All @@ -51,7 +59,11 @@
|
*/

<<<<<<< HEAD
'url' => env('APP_URL', $_ENV['APP_URL']),
=======
'url' => env('APP_URL', 'http://localhost'),
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -103,7 +115,11 @@
|
*/

<<<<<<< HEAD
'key' => env('APP_KEY', $_ENV['APP_KEY']),
=======
'key' => env('APP_KEY'),
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

'cipher' => 'AES-256-CBC',

Expand Down Expand Up @@ -230,4 +246,8 @@

],

<<<<<<< HEAD
];
=======
];
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
8 changes: 8 additions & 0 deletions config/talk.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
'model' => 'App\User'
],
'broadcast' => [
<<<<<<< HEAD
'enable' => true,
=======
'enable' => false,
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
'app_name' => 'talk-example',
'pusher' => [
'app_id' => env('PUSHER_APP_ID'),
'app_key' => env('PUSHER_KEY'),
'app_secret' => env('PUSHER_SECRET')
]
]
<<<<<<< HEAD
];
=======
];
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
17 changes: 17 additions & 0 deletions public/chat/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ body {
color: #92959E;
}

<<<<<<< HEAD
.people-list .unread-counter {
display: none;
height: 20px;
width: 20px;

-moz-border-radius: 30px;
border-radius: 30px;

background-color: #C5DDEB;
text-align: center;
float: right;
margin-left: 5px;
font-weight: bold;
}
=======
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
.chat {
width: 490px;
float: left;
Expand Down
8 changes: 8 additions & 0 deletions public/chat/js/talk.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ $(document).ready(function () {
}
});

<<<<<<< HEAD
$('#message-data').on('keydown', function(event){
if ((event.keyCode == 10 || event.keyCode == 13) && event.ctrlKey){
$('#talkSendMessage').trigger('submit');
}
});
=======

>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
$('#talkSendMessage').on('submit', function(e) {
e.preventDefault();
var url, request, tag, data;
Expand Down
4 changes: 4 additions & 0 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<<<<<<< HEAD
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : ''}}> Remember Me
=======
<input type="checkbox" name="remember"> Remember Me
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
</label>
</div>
</div>
Expand Down
30 changes: 30 additions & 0 deletions resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
@section('content')
<div class="container">
<div class="row">
<<<<<<< HEAD
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-success">
<div class="panel-heading">List of users to chat with</div>
@if(Auth::check())
<!-- Table -->
<table class="table">
@foreach($users as $user)
@if ($user['id'] == Auth::user()->id)
@continue
@endif
<tr>
<td class="username">
{{ $user['name'] }}
</td>
<td>
<a href="{{route('message.read', ['id'=>$user->id])}}" class="btn btn-success pull-right">Send Message</a>
</td>
</tr>
@endforeach
</table>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
=======
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">All Users</div>
Expand All @@ -27,3 +56,4 @@
</div>
</div>
@endsection
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
3 changes: 3 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
</form>
</li>
</ul>
<<<<<<< HEAD
=======

>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
</li>
@endif
</ul>
Expand Down
18 changes: 18 additions & 0 deletions resources/views/layouts/chat.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<head>
<meta charset="UTF-8">
<meta name="csrf-token" content="{{csrf_token()}}">
<<<<<<< HEAD
<title>Test Chat 123</title>
=======
<title>Talk Message</title>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93


<link rel="stylesheet" href="{{asset('chat/css/reset.css')}}">
Expand All @@ -20,7 +24,11 @@
<body>
<div class="header">
<div class="container header-brand">
<<<<<<< HEAD
<a href="{{url('/home')}}" class="brand">Test Chat 123</a>
=======
<a href="{{url('/home')}}" class="brand">Talk Message</a>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
</div>
</div>
<div class="container clearfix body">
Expand Down Expand Up @@ -86,9 +94,19 @@

$('#talkMessages').append(html);
}
<<<<<<< HEAD
var conShow = funtion(data){
console.log(data);
}
=======
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

</script>
{!! talk_live(['user'=>["id"=>auth()->user()->id, 'callback'=>['msgshow']]]) !!}

</body>
<<<<<<< HEAD
</html>
=======
</html>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
37 changes: 37 additions & 0 deletions resources/views/partials/peoplelist.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
<div class="people-list" id="people-list">
<<<<<<< HEAD
<script>
var con_show = function(data){
console.log(data);
var con_id = data.conversation_id;
var msg = data.message;
var el = $("[con_id=" + con_id + "]");
if (el.length == 0)
return; /* case of new conversation */
el.find(".last-message").text(msg);
el.find(".unread-counter").text(function(i, old){
if (old == '')
return 1;
return old++;
});
el.find(".unread-counter").show();
};
</script>
=======
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
<div class="search" style="text-align: center">
<a href="{{url('/home')}}" style="font-size:16px; text-decoration:none; color: white;"><i class="fa fa-user"></i> {{auth()->user()->name}}</a>
</div>
<ul class="list">
@foreach($threads as $inbox)
@if(!is_null($inbox->thread))
<<<<<<< HEAD
<li class="clearfix" con_id={{$inbox->thread->conversation_id}}>
=======
<li class="clearfix">
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
<a href="{{route('message.read', ['id'=>$inbox->withUser->id])}}">
<img src="{{$inbox->withUser->avatar}}" alt="avatar" />
<div class="about">
Expand All @@ -14,13 +38,26 @@
@if(auth()->user()->id == $inbox->thread->sender->id)
<span class="fa fa-reply"></span>
@endif
<<<<<<< HEAD
<span class="last-message">{{substr($inbox->thread->message, 0, 20)}}</span>
<span class="unread-counter"></span>
=======
<span>{{substr($inbox->thread->message, 0, 20)}}</span>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
</div>
</div>
</a>
</li>
<<<<<<< HEAD
{!! talk_live(['conversation'=>['id'=>$inbox->thread->conversation_id, 'callback'=>['con_show']]]) !!}
=======
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
@endif
@endforeach

</ul>
<<<<<<< HEAD
</div>
=======
</div>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
15 changes: 15 additions & 0 deletions resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<<<<<<< HEAD
<title>Test chat 123</title>
=======
<title>Talk Message</title>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93

<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
Expand Down Expand Up @@ -78,6 +82,12 @@

<div class="content">
<div class="title m-b-md">
<<<<<<< HEAD
Test Chat 123
</div>

<div class="links">
=======
Talk
</div>

Expand All @@ -89,9 +99,14 @@
<p>
This is a demo project for Talk. So lets start your journey.
</p>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
<a href="{{url('/register')}}" class="">Registration</a>
</div>
</div>
</div>
</body>
<<<<<<< HEAD
</html>
=======
</html>
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93
9 changes: 9 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

Route::get('tests', 'MessageController@tests');

<<<<<<< HEAD
Route::get('/home', 'MessageController@index');
=======
Route::get('/home', 'HomeController@index');
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93


Route::get('message/{id}', 'MessageController@chatHistory')->name('message.read');
Expand All @@ -29,3 +33,8 @@
Route::delete('message/delete/{id}', 'MessageController@ajaxDeleteMessage')->name('message.delete');
});

<<<<<<< HEAD

Auth::routes();
=======
>>>>>>> 08ed55357d1124fbf16f3a0a8a1d11baa1561e93