Chat feature

This commit is contained in:
Daniel Brendel
2023-10-15 15:32:05 +02:00
parent 4ded5d6e0d
commit 34d1849365
17 changed files with 557 additions and 6 deletions
+19
View File
@@ -91,6 +91,25 @@ class UserModel extends \Asatru\Database\Model {
}
}
/**
* @param $id
* @return void
* @throws \Exception
*/
public static function updateLastSeenMsg($id)
{
try {
$user = static::getAuthUser();
if (!$user) {
throw new \Exception('User not authenticated');
}
static::raw('UPDATE `' . self::tableName() . '` SET last_seen_msg = ? WHERE id = ?', [$id, $user->get('id')]);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Return the associated table name of the migration
*