@@ -31,19 +31,19 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $dates = ['deleted_at']; |
|
| 34 | + protected $dates = [ 'deleted_at' ]; |
|
| 35 | 35 | /** |
| 36 | 36 | * The attributes that are not mass assignable. |
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - protected $guarded = []; |
|
| 40 | + protected $guarded = [ ]; |
|
| 41 | 41 | |
| 42 | 42 | public static function boot() |
| 43 | 43 | { |
| 44 | 44 | parent::boot(); |
| 45 | 45 | |
| 46 | - static::deleting(function (Shop $shop) { |
|
| 46 | + static::deleting(function(Shop $shop) { |
|
| 47 | 47 | $shop->sales()->delete(); |
| 48 | 48 | }); |
| 49 | 49 | } |
@@ -40,19 +40,19 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $dates = ['deleted_at']; |
|
| 43 | + protected $dates = [ 'deleted_at' ]; |
|
| 44 | 44 | /** |
| 45 | 45 | * The attributes that are not mass assignable. |
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $fillable = ['name', 'capacity', 'make_id', 'warehouse_id']; |
|
| 49 | + protected $fillable = [ 'name', 'capacity', 'make_id', 'warehouse_id' ]; |
|
| 50 | 50 | |
| 51 | 51 | public static function boot() |
| 52 | 52 | { |
| 53 | 53 | parent::boot(); |
| 54 | 54 | |
| 55 | - static::deleting(function (Rack $rack) { |
|
| 55 | + static::deleting(function(Rack $rack) { |
|
| 56 | 56 | $rack->guitars()->delete(); |
| 57 | 57 | }); |
| 58 | 58 | } |
@@ -31,19 +31,19 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $dates = ['deleted_at']; |
|
| 34 | + protected $dates = [ 'deleted_at' ]; |
|
| 35 | 35 | /** |
| 36 | 36 | * The attributes that are mass assignable. |
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - protected $fillable = ['name', 'location']; |
|
| 40 | + protected $fillable = [ 'name', 'location' ]; |
|
| 41 | 41 | |
| 42 | 42 | public static function boot() |
| 43 | 43 | { |
| 44 | 44 | parent::boot(); |
| 45 | 45 | |
| 46 | - static::deleting(function (Supplier $supplier) { |
|
| 46 | + static::deleting(function(Supplier $supplier) { |
|
| 47 | 47 | $supplier->purchases()->delete(); |
| 48 | 48 | }); |
| 49 | 49 | } |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * @var array |
| 31 | 31 | */ |
| 32 | - protected $dates = ['deleted_at']; |
|
| 32 | + protected $dates = [ 'deleted_at' ]; |
|
| 33 | 33 | /** |
| 34 | 34 | * The attributes that are mass assignable. |
| 35 | 35 | * |
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | - protected $fillable = ['name']; |
|
| 38 | + protected $fillable = [ 'name' ]; |
|
| 39 | 39 | |
| 40 | 40 | public static function boot() |
| 41 | 41 | { |
| 42 | 42 | parent::boot(); |
| 43 | 43 | |
| 44 | - static::deleting(function (Warehouse $warehouse) { |
|
| 44 | + static::deleting(function(Warehouse $warehouse) { |
|
| 45 | 45 | $warehouse->racks()->delete(); |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | public function addOrUpdateRack($rack) |
| 140 | 140 | { |
| 141 | 141 | (array_has($rack, 'id')) ? |
| 142 | - $this->racks()->find($rack['id'])->update($rack) : $this->addRack($rack); |
|
| 142 | + $this->racks()->find($rack[ 'id' ])->update($rack) : $this->addRack($rack); |
|
| 143 | 143 | |
| 144 | 144 | return $this; |
| 145 | 145 | } |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @var array |
| 51 | 51 | */ |
| 52 | - protected $dates = ['deleted_at']; |
|
| 52 | + protected $dates = [ 'deleted_at' ]; |
|
| 53 | 53 | /** |
| 54 | 54 | * The attributes that are not mass assignable. |
| 55 | 55 | * |
| 56 | 56 | * @var array |
| 57 | 57 | */ |
| 58 | - protected $guarded = []; |
|
| 58 | + protected $guarded = [ ]; |
|
| 59 | 59 | |
| 60 | 60 | public static function boot() |
| 61 | 61 | { |
| 62 | 62 | parent::boot(); |
| 63 | 63 | |
| 64 | - static::deleting(function (Guitar $guitar) { |
|
| 64 | + static::deleting(function(Guitar $guitar) { |
|
| 65 | 65 | $guitar->sale->delete(); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -146,6 +146,6 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function isSold() |
| 148 | 148 | { |
| 149 | - return ! is_null($this->sale); |
|
| 149 | + return !is_null($this->sale); |
|
| 150 | 150 | } |
| 151 | 151 | } |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @var array |
| 61 | 61 | */ |
| 62 | - protected $guarded = []; |
|
| 62 | + protected $guarded = [ ]; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Date mutators. |
| 66 | 66 | * |
| 67 | 67 | * @var array |
| 68 | 68 | */ |
| 69 | - protected $dates = ['date_purchased', 'delivery_date', 'deleted_at']; |
|
| 69 | + protected $dates = [ 'date_purchased', 'delivery_date', 'deleted_at' ]; |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Default date format. |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | parent::boot(); |
| 81 | 81 | |
| 82 | - static::deleting(function (Purchase $purchase) { |
|
| 82 | + static::deleting(function(Purchase $purchase) { |
|
| 83 | 83 | $purchase->guitars()->delete(); |
| 84 | 84 | $purchase->notifications()->delete(); |
| 85 | 85 | }); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($this->delivery_date->isFuture()) { |
| 132 | 132 | return self::UPCOMING; |
| 133 | 133 | } |
| 134 | - if ( ! $this->isPendingStorage()) { |
|
| 134 | + if (!$this->isPendingStorage()) { |
|
| 135 | 135 | return self::COMPLETED; |
| 136 | 136 | } |
| 137 | 137 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | { |
| 249 | 249 | $notification = $this->notifications()->create([ |
| 250 | 250 | 'icon' => 'flight_land', |
| 251 | - 'link' => '/purchases/' . $this->id, |
|
| 251 | + 'link' => '/purchases/'.$this->id, |
|
| 252 | 252 | 'message' => "Purchase of {$this->quantity} {$this->make->name} has arrived from {$this->supplier->name}, {$this->supplier->location}.", |
| 253 | 253 | ]); |
| 254 | 254 | |
@@ -32,19 +32,19 @@ |
||
| 32 | 32 | /** |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $dates = ['deleted_at']; |
|
| 35 | + protected $dates = [ 'deleted_at' ]; |
|
| 36 | 36 | /** |
| 37 | 37 | * The attributes that are not mass assignable. |
| 38 | 38 | * |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - protected $guarded = []; |
|
| 41 | + protected $guarded = [ ]; |
|
| 42 | 42 | |
| 43 | 43 | public static function boot() |
| 44 | 44 | { |
| 45 | 45 | parent::boot(); |
| 46 | 46 | |
| 47 | - static::deleting(function (Make $make) { |
|
| 47 | + static::deleting(function(Make $make) { |
|
| 48 | 48 | $make->models()->delete(); |
| 49 | 49 | $make->racks()->delete(); |
| 50 | 50 | $make->purchases()->delete(); |
@@ -34,19 +34,19 @@ |
||
| 34 | 34 | /** |
| 35 | 35 | * @var array |
| 36 | 36 | */ |
| 37 | - protected $dates = ['deleted_at']; |
|
| 37 | + protected $dates = [ 'deleted_at' ]; |
|
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are not mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $guarded = []; |
|
| 43 | + protected $guarded = [ ]; |
|
| 44 | 44 | |
| 45 | 45 | public static function boot() |
| 46 | 46 | { |
| 47 | 47 | parent::boot(); |
| 48 | 48 | |
| 49 | - static::deleting(function (Model $model) { |
|
| 49 | + static::deleting(function(Model $model) { |
|
| 50 | 50 | $model->guitars()->delete(); |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | { |
| 15 | 15 | \DB::table('warehouses')->delete(); |
| 16 | 16 | |
| 17 | - \DB::table('warehouses')->insert(array ( |
|
| 17 | + \DB::table('warehouses')->insert(array( |
|
| 18 | 18 | 0 => |
| 19 | - array ( |
|
| 19 | + array( |
|
| 20 | 20 | 'id' => 1, |
| 21 | 21 | 'name' => 'Warehouse (Kamalpokhari)', |
| 22 | 22 | 'deleted_at' => NULL, |