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
+7 -7
View File
@@ -1,6 +1,6 @@
@extends('layouts.app')
@section('title', ($user->username ?? $user->name) . ' — GameLog')
@section('title', ($user->slug ?? $user->name) . ' — GameLog')
@section('content')
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
@@ -16,8 +16,8 @@
@endif
<div class="flex-1">
<h1 class="text-2xl font-bold text-white">{{ $user->username ?? $user->name }}</h1>
@if($user->username && $user->name !== $user->username)
<h1 class="text-2xl font-bold text-white">{{ $user->slug ?? $user->name }}</h1>
@if($user->slug && $user->name !== $user->slug)
<p class="text-slate-500 text-sm">{{ $user->name }}</p>
@endif
@if($user->bio)
@@ -65,7 +65,7 @@
following: {{ auth()->user()->isFollowing($user) ? 'true' : 'false' }},
async toggle() {
const method = this.following ? 'DELETE' : 'POST';
const res = await fetch('{{ route('users.follow', $user->username) }}', {
const res = await fetch('{{ route('users.follow', $user->slug) }}', {
method,
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name=csrf-token]').content,
@@ -88,13 +88,13 @@
</div>
@endif
@endauth
<a href="{{ route('users.library', $user->username) }}"
<a href="{{ route('users.library', $user->slug) }}"
class="px-4 py-2 border border-white/10 hover:border-white/20 text-slate-300 hover:text-white text-sm font-medium rounded-lg transition-colors">
View Library
</a>
@auth
@if(auth()->id() !== $user->id)
<a href="{{ route('users.compare', $user->username) }}"
<a href="{{ route('users.compare', $user->slug) }}"
class="px-4 py-2 border border-purple-500/40 hover:border-purple-500 text-purple-300 hover:text-white text-sm font-medium rounded-lg transition-colors">
Compare Libraries
</a>
@@ -124,7 +124,7 @@
<div>
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold text-white">Recent Library</h2>
<a href="{{ route('users.library', $user->username) }}" class="text-sm text-purple-400 hover:text-purple-300 transition-colors">
<a href="{{ route('users.library', $user->slug) }}" class="text-sm text-purple-400 hover:text-purple-300 transition-colors">
View all →
</a>
</div>