16 lines
369 B
PHP
16 lines
369 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
trait HasDeadlineTrait {
|
|
public function getDaysTillDeadlineAttribute(): int {
|
|
return now()->diffInDays($this->deadline, false);
|
|
}
|
|
|
|
public function getDaysTillDeadlineLabelAttribute(): string {
|
|
return $this->daysTillDeadline . ' ' . trans_choice('день|дня|дней', $this->daysTillDeadline);
|
|
}
|
|
|
|
|
|
}
|