Skip to content

Commit

Permalink
Remove tabela não utilizada e inclui e-mail junto ao nome do usuário
Browse files Browse the repository at this point in the history
O e-mail foi incluído para que seja possível identificar unicamente o 
usuário que criou a Thread ou Post, já que o nome cadastrado não 
precisa ser único no sistema.
  • Loading branch information
ablazejuk committed Nov 11, 2017
1 parent aec09f1 commit 3b41f4c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DropPasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('password_resets');
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
4 changes: 2 additions & 2 deletions resources/views/threads/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
@foreach($threads as $thread)
<tr>
<td><a href="{{ url('threads/view/' . $thread->id) }}">{{ $thread->title }}</a></td>
<td>{{ $thread->user->name }}</td>
<td>{{ $thread->user->name . ' <' . $thread->user->email . '>' }}</td>
<td>{{ $thread->posts->count() }}</td>
<td>{{ $thread->posts->last() ? $thread->posts->last()->user->name . ' - ' . date('d/m/Y - H:i:s', strtotime($thread->posts->last()->created_at)) : '-' }}</td>
<td>{{ $thread->posts->last() ? $thread->posts->last()->user->name . ' <' . $thread->posts->last()->user->email . '>' . ' - ' . date('d/m/Y - H:i:s', strtotime($thread->posts->last()->created_at)) : '-' }}</td>
</tr>
@endforeach
</tbody>
Expand Down
9 changes: 7 additions & 2 deletions resources/views/threads/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<small class="pull-left text-muted">
Created by {{ $thread->user->name }} at {{ date('d/m/Y - H:i:s', strtotime($thread->created_at)) }}
Created by {{ $thread->user->name . ' <' . $thread->user->email . '>' }} at {{ date('d/m/Y - H:i:s', strtotime($thread->created_at)) }}
</small>

@if($thread->created_at != $thread->updated_at)
Expand All @@ -52,7 +52,12 @@
<!-- chat item -->
<div class="row">
<div class="name col-md-2 text-center">
{{ $post->user->name }}
<div class="row">
{{ $post->user->name }}
</div>
<div class="row">
{{ '<' . $post->user->email . '>' }}
</div>
</div>
<div class="message col-md-8">
{!! $post->message !!}
Expand Down

0 comments on commit 3b41f4c

Please sign in to comment.