update
This commit is contained in:
37
app/Models/Leaderboard.php
Normal file
37
app/Models/Leaderboard.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user