File tree Expand file tree Collapse file tree 2 files changed +1
-37
lines changed Expand file tree Collapse file tree 2 files changed +1
-37
lines changed Original file line number Diff line number Diff line change 11
11
<tr >
12
12
<td >{{ $cookie -> name } } </td >
13
13
<td >{{ $cookie -> description } } </td >
14
- <td >{{ $cookie -> durationInHumanReadableFormat () } } </td >
14
+ <td >{{ \ Carbon \CarbonInterval :: minutes ( $cookie -> duration ) -> cascade () } } </td >
15
15
</tr >
16
16
@endforeach
17
17
</tbody >
Original file line number Diff line number Diff line change @@ -37,42 +37,6 @@ public function duration(int $minutes): static
37
37
return $ this ;
38
38
}
39
39
40
-
41
- public function durationInHumanReadableFormat (): string
42
- {
43
- $ duration = $ this ->duration ;
44
-
45
- $ years = floor ($ duration / 525600 ); // 1 year = 525600 minutes
46
- $ duration %= 525600 ;
47
-
48
- $ days = floor ($ duration / 1440 ); // 1 day = 1440 minutes
49
- $ duration %= 1440 ;
50
-
51
- $ hours = floor ($ duration / 60 ); // 1 hour = 60 minutes
52
-
53
- $ minutes = $ duration % 60 ;
54
-
55
- $ result = [];
56
-
57
- if ($ years > 0 ) {
58
- $ result [] = "$ years " . trans_choice ('cookieConsent::cookies.year ' , $ years );
59
- }
60
-
61
- if ($ days > 0 ) {
62
- $ result [] = "$ days " . trans_choice ('cookieConsent::cookies.day ' , $ days );
63
- }
64
-
65
- if ($ hours > 0 ) {
66
- $ result [] = "$ hours " . trans_choice ('cookieConsent::cookies.hour ' , $ hours );
67
- }
68
-
69
- if ($ minutes > 0 || empty ($ result )) {
70
- $ result [] = "$ minutes " . trans_choice ('cookieConsent::cookies.minute ' , $ minutes );
71
- }
72
-
73
- return implode (", " , $ result );
74
- }
75
-
76
40
/**
77
41
* Set an attribute dynamically.
78
42
*/
You can’t perform that action at this time.
0 commit comments