@@ -41,9 +41,9 @@ |
||
41 | 41 | 'password' => 'required|confirmed|min:6', |
42 | 42 | ]); |
43 | 43 | |
44 | - if (! Hash::check($request->current_password, Auth::user()->password)) { |
|
44 | + if (!Hash::check($request->current_password, Auth::user()->password)) { |
|
45 | 45 | return response()->json( |
46 | - ['current_password' => ['The current password you provided is incorrect.']], 422 |
|
46 | + [ 'current_password' => [ 'The current password you provided is incorrect.' ] ], 422 |
|
47 | 47 | ); |
48 | 48 | } |
49 | 49 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['warehouse', 'guitars']; |
|
15 | + protected $availableIncludes = [ 'warehouse', 'guitars' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['racks']; |
|
15 | + protected $availableIncludes = [ 'racks' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['purchases']; |
|
15 | + protected $availableIncludes = [ 'purchases' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('fractal')) { |
|
3 | +if (!function_exists('fractal')) { |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * @return \Spatie\Fractal\Fractal |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | 'racks.*.capacity' => 'required|integer|min:1', |
43 | 43 | ]); |
44 | 44 | |
45 | - $warehouse = Warehouse::create($request->only(['name'])); |
|
46 | - $racks = $request->input('racks', []); |
|
45 | + $warehouse = Warehouse::create($request->only([ 'name' ])); |
|
46 | + $racks = $request->input('racks', [ ]); |
|
47 | 47 | $warehouse->addRacks($racks); |
48 | 48 | event(new WarehouseWasCreated($warehouse)); |
49 | 49 | } |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | ]); |
66 | 66 | |
67 | 67 | $warehouse = Warehouse::findOrFail($id); |
68 | - $warehouse->update($request->only(['name'])); |
|
68 | + $warehouse->update($request->only([ 'name' ])); |
|
69 | 69 | |
70 | - $racks = $request->input('racks', []); |
|
70 | + $racks = $request->input('racks', [ ]); |
|
71 | 71 | $warehouse->removeRacksNotIn($this->getIdsFrom($racks)); |
72 | 72 | $warehouse->addOrUpdateRacks($racks); |
73 | 73 | event(new WarehouseWasUpdated($warehouse)); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | public function store($id, Request $request) |
45 | 45 | { |
46 | 46 | $purchase = Purchase::findOrFail($id); |
47 | - if (! $purchase->hasArrived() || ! $purchase->isPendingStorage()) { |
|
48 | - return response(['purchase' => ['The purchase has not yet arrived or doesn\'t require addition of guitars.']], |
|
47 | + if (!$purchase->hasArrived() || !$purchase->isPendingStorage()) { |
|
48 | + return response([ 'purchase' => [ 'The purchase has not yet arrived or doesn\'t require addition of guitars.' ] ], |
|
49 | 49 | 422); |
50 | 50 | } |
51 | 51 | |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | |
61 | 61 | $rack = Rack::find($request->input('rack_id')); |
62 | 62 | if ($rack->used >= $rack->capacity) { |
63 | - return response(['rack_id' => ['The selected rack is full.']], 422); |
|
63 | + return response([ 'rack_id' => [ 'The selected rack is full.' ] ], 422); |
|
64 | 64 | } |
65 | 65 | |
66 | - $guitar = Guitar::create($request->only(['rack_id', 'model_id', 'colour', 'price']) + [ |
|
66 | + $guitar = Guitar::create($request->only([ 'rack_id', 'model_id', 'colour', 'price' ]) + [ |
|
67 | 67 | 'make_id' => $purchase->make_id, |
68 | 68 | 'purchase_id' => $purchase->id, |
69 | 69 | 'damaged' => $request->input('damaged'), |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | |
96 | 96 | $rack = Rack::find($request->input('rack_id')); |
97 | 97 | if ($rack->used >= $rack->capacity) { |
98 | - return response(['rack_id' => ['The selected rack is full.']], 422); |
|
98 | + return response([ 'rack_id' => [ 'The selected rack is full.' ] ], 422); |
|
99 | 99 | } |
100 | 100 | |
101 | - $guitar->update($request->only(['rack_id', 'model_id', 'colour', 'price']) + [ |
|
101 | + $guitar->update($request->only([ 'rack_id', 'model_id', 'colour', 'price' ]) + [ |
|
102 | 102 | 'damaged' => $request->input('damaged'), |
103 | 103 | 'condition' => $request->input('damaged') ? $request->input('condition') : null, |
104 | 104 | ]); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $guitar = Guitar::findOrFail($id); |
119 | 119 | |
120 | 120 | if ($guitar->isSold()) { |
121 | - return response(['guitar_id' => ['This guitar has already been sold.']], 422); |
|
121 | + return response([ 'guitar_id' => [ 'This guitar has already been sold.' ] ], 422); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->validate($request, [ |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | |
130 | 130 | $shop = null; |
131 | 131 | if ($request->input('customer_type') == 'shop') { |
132 | - $shop = Shop::create($request->only(['name', 'address']))->id; |
|
132 | + $shop = Shop::create($request->only([ 'name', 'address' ]))->id; |
|
133 | 133 | } |
134 | 134 | |
135 | - $sale = Sale::create($request->only(['name', 'address']) + ['guitar_id' => $id, 'shop_id' => $shop]); |
|
135 | + $sale = Sale::create($request->only([ 'name', 'address' ]) + [ 'guitar_id' => $id, 'shop_id' => $shop ]); |
|
136 | 136 | |
137 | 137 | event(new SaleWasCreated($sale)); |
138 | 138 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $model = Model::create($request->only([ |
47 | 47 | 'name', |
48 | 48 | 'make_id', |
49 | - ]) + ['photo' => config('shop.images.dir').$fileName]); |
|
49 | + ]) + [ 'photo' => config('shop.images.dir').$fileName ]); |
|
50 | 50 | event(new ModelWasCreated($model)); |
51 | 51 | } |
52 | 52 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $this->info('Starting Installation...'); |
33 | 33 | |
34 | - if (! env('APP_KEY')) { |
|
34 | + if (!env('APP_KEY')) { |
|
35 | 35 | $this->info('Generating app key'); |
36 | 36 | Artisan::call('key:generate'); |
37 | 37 | } else { |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->info('Migrating database'); |
42 | - Artisan::call('migrate', ['--force' => true]); |
|
42 | + Artisan::call('migrate', [ '--force' => true ]); |
|
43 | 43 | |
44 | - if (! User::count()) { |
|
44 | + if (!User::count()) { |
|
45 | 45 | $this->info('Seeding initial data'); |
46 | - Artisan::call('db:seed', ['--force' => true]); |
|
46 | + Artisan::call('db:seed', [ '--force' => true ]); |
|
47 | 47 | } else { |
48 | 48 | $this->comment('Skipping - Data already seeded'); |
49 | 49 | } |