changed username to slug

This commit is contained in:
Doar Mihai
2026-05-30 23:47:32 +03:00
parent ece3070676
commit bdb4457e77
15 changed files with 77 additions and 46 deletions
+5 -5
View File
@@ -321,13 +321,13 @@
$commentsData = $comments->map(fn($c) => [
'id' => $c->id,
'body' => $c->body,
'user' => ['name' => $c->user->name, 'username' => $c->user->username],
'user' => ['name' => $c->user->name, 'slug' => $c->user->slug],
'user_id' => $c->user_id,
'created_at' => $c->created_at->diffForHumans(),
'replies' => $c->replies->map(fn($r) => [
'id' => $r->id,
'body' => $r->body,
'user' => ['name' => $r->user->name, 'username' => $r->user->username],
'user' => ['name' => $r->user->name, 'slug' => $r->user->slug],
'user_id' => $r->user_id,
'created_at' => $r->created_at->diffForHumans(),
])->values()->all(),
@@ -375,7 +375,7 @@
<div class="flex items-center gap-2">
<div class="w-7 h-7 rounded-full bg-purple-700 flex items-center justify-center text-xs font-bold text-white flex-shrink-0"
x-text="comment.user.name.charAt(0).toUpperCase()"></div>
<span class="text-sm font-medium text-slate-300" x-text="comment.user.username || comment.user.name"></span>
<span class="text-sm font-medium text-slate-300" x-text="comment.user.slug || comment.user.name"></span>
<span class="text-xs text-slate-600" x-text="comment.created_at"></span>
</div>
<div class="flex items-center gap-2">
@@ -397,7 +397,7 @@
<div class="flex items-center gap-2">
<div class="w-5 h-5 rounded-full bg-purple-800 flex items-center justify-center text-xs font-bold text-white flex-shrink-0"
x-text="reply.user.name.charAt(0).toUpperCase()"></div>
<span class="text-xs font-medium text-slate-300" x-text="reply.user.username || reply.user.name"></span>
<span class="text-xs font-medium text-slate-300" x-text="reply.user.slug || reply.user.name"></span>
<span class="text-xs text-slate-600" x-text="reply.created_at"></span>
</div>
@auth
@@ -451,7 +451,7 @@
<div class="w-7 h-7 rounded-full bg-purple-700 flex items-center justify-center text-xs font-bold text-white">
{{ strtoupper(substr($review->user->name, 0, 1)) }}
</div>
<span class="text-sm font-medium text-slate-300">{{ $review->user->username ?? $review->user->name }}</span>
<span class="text-sm font-medium text-slate-300">{{ $review->user->slug ?? $review->user->name }}</span>
@if($review->has_spoilers)
<span class="px-1.5 py-0.5 text-xs bg-yellow-900/40 text-yellow-400 border border-yellow-700/30 rounded">Spoilers</span>
@endif