gamify reputation added

This commit is contained in:
Benjamin Takats
2023-01-15 17:33:43 +01:00
parent d1c211fd5a
commit 080e7c99b5
5 changed files with 89 additions and 3 deletions

View File

@@ -10,6 +10,8 @@ use RalphJSmit\Laravel\SEO\Support\SEOData;
class HighscoreTable extends Component
{
public Country $country;
public bool $viewingModal = false;
public ?User $modal = null;
public function render()
{
@@ -28,4 +30,17 @@ class HighscoreTable extends Component
)
]);
}
public function openModal($id)
{
$this->modal = User::query()
->with([
'orangePills',
'reputations',
])
->where('id', $id)
->first();
$this->viewingModal = true;
}
}

View File

@@ -60,4 +60,9 @@ class User extends Authenticatable implements MustVerifyEmail, CanComment
{
return $this->hasMany(OrangePill::class);
}
public function reputations()
{
return $this->morphMany('QCod\Gamify\Reputation', 'subject');
}
}