. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Statistics\Repository; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Statistics\Repository\Interfaces\MessageRepositoryInterface; use Illuminate\Database\Capsule\Manager as DB; /** * A repository providing methods for user message related statistics. */ class MessageRepository implements MessageRepositoryInterface { /** * @inheritDoc */ public function totalUserMessages(): string { $total = DB::table('message') ->where('user_id', '=', Auth::id()) ->count(); return I18N::number($total); } }