File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,16 @@ public function participants()
60
60
return $ this ->hasMany ('Cmgmyr\Messenger\Models\Participant ' );
61
61
}
62
62
63
+ /**
64
+ * Returns the user object that created the thread
65
+ *
66
+ * @return mixed
67
+ */
68
+ public function creator ()
69
+ {
70
+ return $ this ->messages ()->latest ()->first ()->user ;
71
+ }
72
+
63
73
/**
64
74
* Returns all of the latest threads by updated_at date
65
75
*
Original file line number Diff line number Diff line change 12
12
<div class =" media alert {{ $class } }" >
13
13
<h4 class =" media-heading" >{{ link_to (' messages/' . $thread -> id , $thread -> subject )} } </h4 >
14
14
<p >{{ $thread -> latestMessage -> body } } </p >
15
+ <p ><small ><strong >Creator:</strong > {{ $thread -> creator ()-> name } } </small ></p >
15
16
<p ><small ><strong >Participants:</strong > {{ $thread -> participantsString (Auth:: id ()) } } </small ></p >
16
17
</div >
17
18
@endforeach
You can’t perform that action at this time.
0 commit comments