Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function create(Ministry $user) |
||
35 | { |
||
36 | if ($user->account->level !== 'Free') { |
||
37 | return true; |
||
38 | } else { |
||
39 | $sermonsCount = Sermon::where('ministry_id', $user->id) |
||
40 | ->whereBetween('created_at', [now()->firstOfMonth(), now()->lastOfMonth()]) |
||
41 | ->count(); |
||
42 | if ($sermonsCount >= SermonHelper::$freeSermonsCount) { |
||
43 | return false; |
||
44 | } else { |
||
45 | return true; |
||
46 | } |
||
76 |