Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function isExpired() :bool |
||
45 | { |
||
46 | if ($this->expired) { |
||
47 | return true; |
||
48 | } |
||
49 | |||
50 | $generatedTime = $this->generated_at->addMinutes($this->validity); |
||
51 | |||
52 | if (strtotime($generatedTime) >= strtotime(Carbon::now()->toDateTimeString())) { |
||
53 | return false; |
||
54 | } |
||
55 | $this->expired = true; |
||
56 | $this->save(); |
||
57 | |||
58 | return true; |
||
59 | } |
||
81 |