@@ -26,6 +26,9 @@ |
||
| 26 | 26 | $child2 = Factory::create(new Category, ['name' => 'Child 2', 'slug' => 'child-2', 'parent_id' => $parent2->id]); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param integer $count |
|
| 31 | + */ |
|
| 29 | 32 | protected function seedProducts($count) |
| 30 | 33 | { |
| 31 | 34 | $categories = Category::count(); |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_category_discount', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_category_discount', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->integer('category_id')->unsigned()->nullable(); |
| 14 | 14 | $table->integer('discount_id')->unsigned()->nullable(); |
| 15 | - $table->primary(['category_id', 'discount_id']); |
|
| 15 | + $table->primary([ 'category_id', 'discount_id' ]); |
|
| 16 | 16 | }); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_discount_product', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_discount_product', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->integer('discount_id')->unsigned()->nullable(); |
| 14 | 14 | $table->integer('product_id')->unsigned()->nullable(); |
| 15 | - $table->primary(['discount_id', 'product_id']); |
|
| 15 | + $table->primary([ 'discount_id', 'product_id' ]); |
|
| 16 | 16 | }); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * @var array Guarded fields |
| 47 | 47 | */ |
| 48 | - protected $guarded = ['*']; |
|
| 48 | + protected $guarded = [ '*' ]; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @var array Fillable fields |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | public function filterFields($fields) |
| 123 | 123 | { |
| 124 | 124 | $fields->amount_exact->hidden = $this->is_percentage; |
| 125 | - $fields->amount_percentage->hidden = ! $this->is_percentage; |
|
| 125 | + $fields->amount_percentage->hidden = !$this->is_percentage; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function scopeIsExpired($query) |
| 135 | 135 | { |
| 136 | - return $query->where(function ($discount) { |
|
| 136 | + return $query->where(function($discount) { |
|
| 137 | 137 | return $discount->whereNotNull('end_at') |
| 138 | 138 | ->where('end_at', '<=', (string) Carbon::now()); |
| 139 | 139 | }); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function scopeIsNotExpired($query) |
| 149 | 149 | { |
| 150 | - return $query->where(function ($discount) { |
|
| 150 | + return $query->where(function($discount) { |
|
| 151 | 151 | return $discount->whereNull('end_at') |
| 152 | 152 | ->orWhere('end_at', '>', (string) Carbon::now()); |
| 153 | 153 | }); |