From 67bf5494fde48d2c67e6439d27466c91fb380278 Mon Sep 17 00:00:00 2001 From: Jaiden Date: Sat, 24 May 2025 23:16:40 -0400 Subject: [PATCH] wtf --- app/Livewire/App/Pfp.php | 6 ++++-- app/Livewire/Pages/Profile.php | 4 ++-- app/Livewire/Pages/Upload.php | 2 +- .../0001_01_01_000000_create_users_table.php | 10 +--------- resources/views/livewire/app/navbar.blade.php | 10 +++++----- resources/views/livewire/app/pfp.blade.php | 5 +++-- resources/views/livewire/pages/profile.blade.php | 2 +- resources/views/livewire/posts/comment.blade.php | 2 +- 8 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/Livewire/App/Pfp.php b/app/Livewire/App/Pfp.php index 01e23b1..cbfec0d 100644 --- a/app/Livewire/App/Pfp.php +++ b/app/Livewire/App/Pfp.php @@ -7,14 +7,16 @@ use Livewire\Component; class Pfp extends Component { - public User $user; + public string $user = ''; public string $size = '3rem'; public string $shape = 'circle'; public function render() { + $u = User::find($this->user); return view('livewire.app.pfp', [ - 'pfp' => $this->user->getAvatarBase64() + 'pfp' =>$u->getAvatarBase64(), + 'name' => $u->name, ]); } } diff --git a/app/Livewire/Pages/Profile.php b/app/Livewire/Pages/Profile.php index 4401ce3..cb3d29a 100644 --- a/app/Livewire/Pages/Profile.php +++ b/app/Livewire/Pages/Profile.php @@ -22,14 +22,14 @@ class Profile extends Component return view('livewire.pages.profile')->title($this->user->name); } - public function updated($name, $value) + public function updated() { if (Auth::id() != $this->user->id) { abort(401); } - $this->validateOnly($name); + $this->validate(); $this->user->avatarExt = $this->avatar->getClientOriginalExtension(); $this->user->save(); diff --git a/app/Livewire/Pages/Upload.php b/app/Livewire/Pages/Upload.php index 8b4af0e..c7475d4 100644 --- a/app/Livewire/Pages/Upload.php +++ b/app/Livewire/Pages/Upload.php @@ -55,7 +55,7 @@ class Upload extends Component $preview = Image::read($fullImg)->scaleDown(width: 1280, height: 720); Storage::put("posts/$post->id/preview", $preview->encodeByExtension($post->extension, quality: 70)); - return $this->redirect('/'); + return $this->redirect("/posts/$post->id"); } } diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index d5e7e7f..3294c39 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -16,18 +16,11 @@ return new class extends Migration $table->id(); $table->string('name'); $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); + $table->string('avatarExt')->nullable(); $table->rememberToken(); $table->timestamps(); }); - Schema::create('password_reset_tokens', function (Blueprint $table) { - $table->string('email')->primary(); - $table->string('token'); - $table->timestamp('created_at')->nullable(); - }); - Schema::create('sessions', function (Blueprint $table) { $table->string('id')->primary(); $table->foreignId('user_id')->nullable()->index(); @@ -45,7 +38,6 @@ return new class extends Migration public function down(): void { Schema::dropIfExists('users'); - Schema::dropIfExists('password_reset_tokens'); Schema::dropIfExists('sessions'); } }; diff --git a/resources/views/livewire/app/navbar.blade.php b/resources/views/livewire/app/navbar.blade.php index 2c40d98..41e18ee 100644 --- a/resources/views/livewire/app/navbar.blade.php +++ b/resources/views/livewire/app/navbar.blade.php @@ -35,12 +35,12 @@ @endguest @auth -
- - + + +
+ @endauth diff --git a/resources/views/livewire/app/pfp.blade.php b/resources/views/livewire/app/pfp.blade.php index 5aaa21e..e0f1867 100644 --- a/resources/views/livewire/app/pfp.blade.php +++ b/resources/views/livewire/app/pfp.blade.php @@ -1,2 +1,3 @@ - - +
+ +
diff --git a/resources/views/livewire/pages/profile.blade.php b/resources/views/livewire/pages/profile.blade.php index 140c864..146d81a 100644 --- a/resources/views/livewire/pages/profile.blade.php +++ b/resources/views/livewire/pages/profile.blade.php @@ -1,7 +1,7 @@