I have installed Cmgmyr\Messenger, however, I need to extend the Thread model and potentially a couple of the others as my users table does not contain a name
field.
The method I need to extend is:
/**
* Generates a string of participant information
*
* @param null $userId
* @param array $columns
* @return string
*/
public function participantsString($userId=null, $columns=['name'])
{
$selectString = $this->createSelectString($columns);
$participantNames = $this->getConnection()->table('users')
->join('participants', 'users.id', '=', 'participants.user_id')
->where('participants.thread_id', $this->id)
->select($this->getConnection()->raw($selectString));
if ($userId !== null) {
$participantNames->where('users.id', '!=', $userId);
}
$userNames = $participantNames->lists('users.name');
return implode(', ', $userNames);
}
Notice the users.name filed being called? This is what needs to be changed to username or even better users.firstname and users.lastname together.
I need to extend it to the following structure:
Modules/
- Email/
- Models/
- Thread.php
How can I go about this?