<li><a href="#">Mailbox</a></li>
    <li><a href="#">Inbox</a></li>
</ol>
@stop
<!-- /breadcrumbs -->
<!-- content -->
@section('content')

<div class="box box-primary">
    <div class="box-header">
        <h3 class="box-title">Emails List</h3>
    </div>

    <div class="box-body no-padding">
        <?php 
$threads = App\Thread::paginate(5);
?>
        <div class="table-responsive mailbox-messages">

            <table class="table table-hover table-striped">

                @foreach($threads as $thread)
                <tr class="read">

                    <td class="contact">
                        <a href="{!! url('readmail/'.$thread->id) !!}">
                            {!! $thread->name !!}
                        </a>
                    </td>
                    <td class="contact">
                        <a href="{!! url('readmail/'.$thread->id) !!}">
<ol class="breadcrumb">
    <li><a href="#">Mailbox</a></li>
    <li><a href="#">Inbox</a></li>
    <li><a href="#">Read Mail</a></li>
</ol>
@stop
<!-- /breadcrumbs -->
<!-- content -->
@section('content')
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">Read Mail</h3>
    </div>

    <?php 
$thread = App\Thread::where('id', '=', $id)->first();
?>
    <div class="box-body no-padding">
        <div class="mailbox-read-info">
            <h3>{!! $thread->title !!}</h3>
            <h5>From: {!! $thread->email !!} <span class="mailbox-read-time pull-right">{!! $thread->created_at !!}</span></h5>
        </div>
        <div class="mailbox-read-message">
            
            <?php 
$attachment = \App\Attcahment::where('thread_id', '=', $thread->id)->first();
if ($attachment == null) {
    $body = $thread->body;
} else {
    // dd($attachment->file);
    // print $attachment->file;