mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
23 lines
552 B
PHP
23 lines
552 B
PHP
<?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);
|
|
}
|
|
}
|