Total Complexity | 12 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Settings extends Model |
||
8 | { |
||
9 | /** |
||
10 | * The attributes that are mass assignable. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $fillable = [ |
||
15 | 'exchanges_start_at', |
||
16 | 'exchanges_end_at', |
||
17 | 'enrollments_start_at', |
||
18 | 'enrollments_end_at', |
||
19 | 'groups_creation_start_at', |
||
20 | 'groups_creation_end_at', |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * The attributes that should be mutated to dates. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $dates = [ |
||
29 | 'created_at', |
||
30 | 'updated_at', |
||
31 | 'exchanges_start_at', |
||
32 | 'exchanges_end_at', |
||
33 | 'enrollments_start_at', |
||
34 | 'enrollments_end_at', |
||
35 | 'groups_creation_start_at', |
||
36 | 'groups_creation_end_at', |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * Checks whether today's date is within the shift exchanging period. |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function withinExchangePeriod(): bool |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Checks whether today's date is within the course enrollment period. |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function withinEnrollmentPeriod(): bool |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Checks whether today's date is within the group creation period. |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function withinGroupCreationPeriod(): bool |
||
81 |