mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
Add post deletion w/ confirmation, search (broken), profile page
This commit is contained in:
parent
bfb497c367
commit
827d125639
21 changed files with 374 additions and 27 deletions
23
app/Livewire/Pages/Profile.php
Normal file
23
app/Livewire/Pages/Profile.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Pages;
|
||||
|
||||
use App\Models\Comment;
|
||||
use App\Models\Post;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class Profile extends Component
|
||||
{
|
||||
public User $user;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$favorite_posts = $this->user->favorites()->withType(Post::class)->count();
|
||||
$favorite_comments = $this->user->favorites()->withType(Comment::class)->count();
|
||||
|
||||
return view('livewire.pages.profile', [
|
||||
'favorite_posts' => $favorite_posts, 'favorite_comments' => $favorite_comments
|
||||
])->title($this->user->name);
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ class Upload extends Component
|
|||
{
|
||||
use WithFileUploads;
|
||||
|
||||
#[Validate('extensions:jpg,jpeg,bmp,gif,png,webp,apng,mp4,wmv,mkv|mimes:jpg,jpeg,bmp,gif,png,webp,apng,mp4,wmv,mkv|max:81920')]
|
||||
#[Validate('file')]
|
||||
public $file;
|
||||
|
||||
#[Validate('required|in:safe,suggestive,explicit')]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue