Replace Auth System #3

Merged
w33b merged 19 commits from auth-redo into main 2026-01-09 15:11:37 +00:00
6 changed files with 12 additions and 38 deletions
Showing only changes of commit e100f3bf23 - Show all commits

View File

@@ -1,22 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
class UserController extends Controller
{
/**
* Display User Page.
*/
public function index(string $username): \Illuminate\View\View
{
$user = User::where('name', $username)
->select('id', 'name', 'discord_id', 'discord_name', 'discord_avatar', 'created_at', 'is_patreon')
->firstOrFail();
return view('user.index', [
'user' => $user,
]);
}
}

View File

@@ -34,7 +34,7 @@
@foreach($comments as $comment)
<tr wire:key="comment-{{ $comment->id }}" class="bg-white border-t dark:bg-neutral-800 dark:border-pink-700">
<td class="px-6 py-4">
<a href="{{ route('user.index', ['username' => $comment->name]) }}">{{ $comment->name }}</a>
{{ $comment->name }}
</td>
<th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white max-w-lg">
{{ $comment->comment }}

View File

@@ -4,20 +4,18 @@
<!-- Header -->
<div class="flex text-sm font-light bg-neutral-950/50 backdrop-blur-lg rounded-lg p-10 gap-2">
<a href="{{ route('user.index', ['username' => $playlist->user->name]) }}">
<div>
@if ($playlist->user->discord_avatar)
<img class="relative w-24 h-24 flex-none rounded-full shadow-lg"
src="https://external-content.duckduckgo.com/iu/?u=https://cdn.discordapp.com/avatars/{{ $playlist->user->discord_id }}/{{ $playlist->user->discord_avatar }}.webp">
@else
<img class="relative w-24 h-24 flex-none rounded-full shadow-lg" src="/images/default-avatar.webp">
@endif
</a>
</div>
<div class="flex flex-col justify-center flex-1 pl-4">
<h1 class="font-bold text-3xl">{{ $playlist->name }}</h1>
<p class="font-light text-lg text-neutral-200">Episodes: {{ count($playlistEpisodes) }}</p>
<p class="font-light text-lg text-neutral-200">Creator: <a
href="{{ route('user.index', ['username' => $playlist->user->name]) }}">{{ $playlist->user->name }}</a>
</p>
<p class="font-light text-lg text-neutral-200">Creator: {{ $playlist->user->name }}</p>
</div>
<div class="flex flex-col justify-center pl-4">
<div class="flex justify-end">

View File

@@ -5,21 +5,21 @@
@endphp
<div id="comment-{{ $comment->id }}" class="flex rounded-lg bg-white p-1 mb-2 shadow-[0_2px_15px_-3px_rgba(0,0,0,0.07),0_10px_20px_-2px_rgba(0,0,0,0.04)] dark:bg-neutral-900">
@php $user = cache()->rememberForever('commentUser'.$comment->commenter_id, fn () => \App\Models\User::where('id', $comment->commenter_id)->first()); @endphp
<a class="contents" href="{{ route('user.index', ['username' => $user->name]) }}">
<div>
@if($user->discord_avatar)
<img class="w-16 h-16 rounded-full m-2" src="https://external-content.duckduckgo.com/iu/?u=https://cdn.discordapp.com/avatars/{{ $user->discord_id }}/{{ $user->discord_avatar }}.webp" alt="{{ $user->discord_name ?? $user->name }} Avatar">
@else
<img class="w-16 h-16 rounded-full m-2" src="/images/default-avatar.webp" alt="{{ $user->discord_name ?? $user->name }} Avatar">
@endif
</a>
</div>
<div class="text-gray-800 dark:text-gray-200">
<a href="{{ route('user.index', ['username' => $user->name]) }}">
<div>
@if($user->is_patreon)
<h5 class="text-gray-800 dark:text-gray-400">{{ $user->discord_name ?? $user->name }} <a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600 animate-pulse"></i></a> <small class="text-muted">- {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}</small></h5>
@else
<h5 class="text-gray-800 dark:text-gray-400">{{ $user->discord_name ?? $user->name }} <small class="text-muted">- {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}</small></h5>
@endif
</a>
</div>
<div style="white-space: pre-wrap;">{!! $markdown->line($comment->comment) !!}</div>
<br />
</div>

View File

@@ -7,22 +7,22 @@
<div id="comment-{{ $comment->getKey() }}" class="flex rounded-lg p-1 mb-2 ">
<a class="contents" href="{{ route('user.index', ['username' => $comment->commenter->name]) }}">
<div class="contents">
@if($comment->commenter->discord_avatar)
<img class="w-12 h-12 rounded-lg m-2" src="https://external-content.duckduckgo.com/iu/?u=https://cdn.discordapp.com/avatars/{{ $comment->commenter->discord_id }}/{{ $comment->commenter->discord_avatar }}.webp" alt="{{ $comment->commenter->discord_name ?? $comment->commenter->name }} Avatar">
@else
<img class="w-12 h-12 rounded-lg m-2" src="/images/default-avatar.webp" alt="{{ $comment->commenter->discord_name ?? $comment->commenter->name }} Avatar">
@endif
</a>
</div>
<div class="text-gray-800 dark:text-gray-200">
<a href="{{ route('user.index', ['username' => $comment->commenter->name]) }}">
<div>
@if($comment->commenter->is_patreon)
<h5 class="text-gray-800 dark:text-gray-400">{{ $comment->commenter->discord_name ?? $comment->commenter->name }} <a data-te-toggle="tooltip" title="Badge of appreciation for the horny people supporting us! :3"><i class="fa-solid fa-hand-holding-heart text-rose-600 animate-pulse"></i></a> <small class="text-muted">- {{ $comment->created_at->diffForHumans() }}</small></h5>
@else
<h5 class="text-gray-800 dark:text-gray-400">{{ $comment->commenter->discord_name ?? $comment->commenter->name }} <small class="text-muted">- {{ $comment->created_at->diffForHumans() }}</small></h5>
@endif
</a>
</div>
<div style="white-space: pre-wrap;">{!! $markdown->line($comment->comment) !!}</div>
@if (! Illuminate\Support\Facades\Route::is('profile.comments'))

View File

@@ -86,8 +86,6 @@ Route::middleware('auth')->group(function () {
Route::get('/download-search', [HomeController::class, 'downloadSearch'])->name('download.search');
});
Route::get('/user/{username}', [UserController::class, 'index'])->name('user.index');
/*
|---------------------------------------------------------------------------------
| Admin Pages