1. Split getContact into getHistoryContact and getNewContact 2. Now contacts with new messages will go on top of the list
15 lines
273 B
PHP
15 lines
273 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MessageContact extends Model
|
|
{
|
|
protected $fillable = ['user_id', 'contact_id', 'unread_count'];
|
|
public function contact()
|
|
{
|
|
return $this->belongsTo('App\User', 'contact_id');
|
|
}
|
|
}
|