| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Cooldown extends Model |
||
| 8 | { |
||
| 9 | protected $table = 'kurozora_cooldowns'; |
||
| 10 | protected $guarded = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * The attributes that should be mutated to dates. |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $dates = [ |
||
| 18 | 'expires_at', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Returns the model associated with the cooldown. |
||
| 23 | * |
||
| 24 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
| 25 | */ |
||
| 26 | public function model() |
||
| 27 | { |
||
| 28 | return $this->morphTo(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Scope a query to only include expired cooldowns. |
||
| 33 | * |
||
| 34 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
| 35 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 36 | */ |
||
| 37 | public function scopeExpired($query) |
||
| 40 | } |
||
| 41 | } |