38 lines
768 B
PHP
38 lines
768 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Leaderboard extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public const TYPE_CREATOR = 'creator';
|
|
public const TYPE_ARTWORK = 'artwork';
|
|
public const TYPE_STORY = 'story';
|
|
|
|
public const PERIOD_DAILY = 'daily';
|
|
public const PERIOD_WEEKLY = 'weekly';
|
|
public const PERIOD_MONTHLY = 'monthly';
|
|
public const PERIOD_ALL_TIME = 'all_time';
|
|
|
|
protected $fillable = [
|
|
'type',
|
|
'entity_id',
|
|
'score',
|
|
'period',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'entity_id' => 'integer',
|
|
'score' => 'float',
|
|
];
|
|
}
|
|
}
|