@forelse($messages as $msg)
@php
$isSecret = $msg->secret == 1;
$isToMe = Auth::check() && $msg->towho === Auth::user()->username;
$isFromMe = Auth::check() && $msg->who === Auth::user()->username;
@endphp
@if ($isSecret)
@endif
@empty
🔒 私密信件
@endif
{{ $msg->who }}
给
{{ $msg->towho ?: '大家' }}
留言:
{{ \Carbon\Carbon::parse($msg->post_time)->diffForHumans() }}
@if ($isFromMe || $isToMe || (Auth::check() && Auth::user()->user_level >= 15))
@endif
{!! nl2br(e($msg->text_body)) !!}
@if (!Auth::check() || $msg->who !== Auth::user()->username)
📭
@endforelse
{{-- 分页 --}}
暂无信件
这里是空空如也的荒原。
{{ $messages->links() }}