| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function hasRecentlyPaid(int $userId, int $days = 7) |
||
| 25 | { |
||
| 26 | return $this |
||
| 27 | ->model |
||
| 28 | ->join('jobs', function (JoinClause $join) use ($userId) { |
||
| 29 | return $join->on('jobs.id', '=', 'job_id')->on('user_id', $this->raw($userId)); |
||
| 30 | }) |
||
| 31 | ->where('payments.created_at', '>', Carbon::now()->subDay($days)) |
||
| 32 | ->where('status_id', Payment::PAID) |
||
| 33 | ->exists(); |
||
| 34 | } |
||
| 35 | |||
| 69 |