Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
69 | public function scopePublished($query): Builder |
||
70 | { |
||
71 | return $query->where('public', true) |
||
72 | ->where(function ($query) { |
||
73 | $today = (new Carbon)->toDateString(); |
||
74 | |||
75 | $query->where(function ($query) use ($today) { |
||
76 | $query->whereDate('public_from', '<=', $today)->orWhereNull('public_from'); |
||
77 | }) |
||
78 | ->where(function ($query) use ($today) { |
||
79 | $query->whereDate('public_until', '>=', $today)->orWhereNull('public_until'); |
||
80 | }); |
||
84 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.