44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class GroupContributorStat extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'group_id',
|
|
'user_id',
|
|
'credited_artworks_count',
|
|
'release_count',
|
|
'project_count',
|
|
'review_actions_count',
|
|
'approved_submissions_count',
|
|
'reputation_meta_json',
|
|
];
|
|
|
|
protected $casts = [
|
|
'credited_artworks_count' => 'integer',
|
|
'release_count' => 'integer',
|
|
'project_count' => 'integer',
|
|
'review_actions_count' => 'integer',
|
|
'approved_submissions_count' => 'integer',
|
|
'reputation_meta_json' => 'array',
|
|
];
|
|
|
|
public function group(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Group::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |