@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | 'deleted_at', |
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | - public function __construct(array $attributes = []) |
|
| 41 | + public function __construct(array $attributes = [ ]) |
|
| 42 | 42 | { |
| 43 | 43 | parent::__construct($attributes); |
| 44 | 44 | |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | public function scopePublished($query): Builder |
| 79 | 79 | { |
| 80 | 80 | return $query->where('public', true) |
| 81 | - ->where(function ($query) { |
|
| 81 | + ->where(function($query) { |
|
| 82 | 82 | $today = (new Carbon)->toDateString(); |
| 83 | 83 | |
| 84 | - $query->where(function ($query) use ($today) { |
|
| 84 | + $query->where(function($query) use ($today) { |
|
| 85 | 85 | $query->whereDate('public_from', '<=', $today)->orWhereNull('public_from'); |
| 86 | 86 | }) |
| 87 | - ->where(function ($query) use ($today) { |
|
| 87 | + ->where(function($query) use ($today) { |
|
| 88 | 88 | $query->whereDate('public_until', '>=', $today)->orWhereNull('public_until'); |
| 89 | 89 | }); |
| 90 | 90 | }); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | 'deleted_at', |
| 36 | 36 | ]; |
| 37 | 37 | |
| 38 | - public function __construct(array $attributes = []) |
|
| 38 | + public function __construct(array $attributes = [ ]) |
|
| 39 | 39 | { |
| 40 | 40 | parent::__construct($attributes); |
| 41 | 41 | |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | public function scopePublished($query): Builder |
| 70 | 70 | { |
| 71 | 71 | return $query->where('public', true) |
| 72 | - ->where(function ($query) { |
|
| 72 | + ->where(function($query) { |
|
| 73 | 73 | $today = (new Carbon)->toDateString(); |
| 74 | 74 | |
| 75 | - $query->where(function ($query) use ($today) { |
|
| 75 | + $query->where(function($query) use ($today) { |
|
| 76 | 76 | $query->whereDate('public_from', '<=', $today)->orWhereNull('public_from'); |
| 77 | 77 | }) |
| 78 | - ->where(function ($query) use ($today) { |
|
| 78 | + ->where(function($query) use ($today) { |
|
| 79 | 79 | $query->whereDate('public_until', '>=', $today)->orWhereNull('public_until'); |
| 80 | 80 | }); |
| 81 | 81 | }); |