@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $this->validate($request, [ |
40 | 40 | 'name' => 'required|max:255', |
41 | - 'email' => 'required|email|unique:users,email,' . Auth::id(), |
|
41 | + 'email' => 'required|email|unique:users,email,'.Auth::id(), |
|
42 | 42 | ]); |
43 | 43 | |
44 | 44 | Auth::user()->fill($request->all())->save(); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | 'racks.*.capacity' => 'required|integer|min:1', |
41 | 41 | ]); |
42 | 42 | |
43 | - $warehouse = Warehouse::create($request->only(['name'])); |
|
44 | - $racks = $request->input('racks', []); |
|
43 | + $warehouse = Warehouse::create($request->only([ 'name' ])); |
|
44 | + $racks = $request->input('racks', [ ]); |
|
45 | 45 | $warehouse->addRacks($racks); |
46 | 46 | } |
47 | 47 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | ]); |
63 | 63 | |
64 | 64 | $warehouse = Warehouse::findOrFail($id); |
65 | - $warehouse->update($request->only(['name'])); |
|
65 | + $warehouse->update($request->only([ 'name' ])); |
|
66 | 66 | |
67 | - $racks = $request->input('racks', []); |
|
67 | + $racks = $request->input('racks', [ ]); |
|
68 | 68 | $warehouse->removeRacksNotIn($this->getIdsFrom($racks)); |
69 | 69 | $warehouse->addOrUpdateRacks($racks); |
70 | 70 | } |
@@ -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 |
@@ -12,7 +12,7 @@ discard block |
||
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. |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | public function transform(Supplier $supplier) |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'id' => (int)$supplier->id, |
|
28 | - 'name' => (string)$supplier->name, |
|
29 | - 'location' => (string)$supplier->location, |
|
27 | + 'id' => (int) $supplier->id, |
|
28 | + 'name' => (string) $supplier->name, |
|
29 | + 'location' => (string) $supplier->location, |
|
30 | 30 | ]; |
31 | 31 | } |
32 | 32 |
@@ -12,7 +12,7 @@ discard block |
||
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. |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | public function transform(Warehouse $warehouse) |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'id' => (int)$warehouse->id, |
|
28 | - 'name' => (string)$warehouse->name, |
|
27 | + 'id' => (int) $warehouse->id, |
|
28 | + 'name' => (string) $warehouse->name, |
|
29 | 29 | ]; |
30 | 30 | } |
31 | 31 |
@@ -12,7 +12,7 @@ discard block |
||
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. |
@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | public function transform(Rack $rack) |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'id' => (int)$rack->id, |
|
28 | - 'name' => (string)$rack->name, |
|
29 | - 'capacity' => (int)$rack->capacity, |
|
30 | - 'used' => (int)$rack->used, |
|
31 | - 'usage' => (float)$rack->usage, |
|
32 | - 'make_id' => (int)$rack->make_id, |
|
27 | + 'id' => (int) $rack->id, |
|
28 | + 'name' => (string) $rack->name, |
|
29 | + 'capacity' => (int) $rack->capacity, |
|
30 | + 'used' => (int) $rack->used, |
|
31 | + 'usage' => (float) $rack->usage, |
|
32 | + 'make_id' => (int) $rack->make_id, |
|
33 | 33 | 'make' => [ |
34 | - 'id' => (int)$rack->make->id, |
|
35 | - 'name' => (string)$rack->make->name, |
|
34 | + 'id' => (int) $rack->make->id, |
|
35 | + 'name' => (string) $rack->make->name, |
|
36 | 36 | ], |
37 | 37 | ]; |
38 | 38 | } |
@@ -41,12 +41,12 @@ |
||
41 | 41 | 'photo' => 'required|image', |
42 | 42 | ]); |
43 | 43 | $photo = $request->file('photo'); |
44 | - $fileName = sha1(time() . $photo->getClientOriginalName()) . '.' . $photo->getClientOriginalExtension(); |
|
44 | + $fileName = sha1(time().$photo->getClientOriginalName()).'.'.$photo->getClientOriginalExtension(); |
|
45 | 45 | $photo->move(config('shop.images.path'), $fileName); |
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 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['supplier', 'guitars']; |
|
15 | + protected $availableIncludes = [ 'supplier', 'guitars' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -24,27 +24,27 @@ discard block |
||
24 | 24 | public function transform(Purchase $purchase) |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'id' => (int)$purchase->id, |
|
28 | - 'supplier_id' => (int)$purchase->supplier_id, |
|
29 | - 'quantity' => (int)$purchase->quantity, |
|
30 | - 'price' => (float)$purchase->price, |
|
31 | - 'stored' => (int)$purchase->stored, |
|
32 | - 'sold' => (int)$purchase->sold, |
|
27 | + 'id' => (int) $purchase->id, |
|
28 | + 'supplier_id' => (int) $purchase->supplier_id, |
|
29 | + 'quantity' => (int) $purchase->quantity, |
|
30 | + 'price' => (float) $purchase->price, |
|
31 | + 'stored' => (int) $purchase->stored, |
|
32 | + 'sold' => (int) $purchase->sold, |
|
33 | 33 | 'make' => [ |
34 | - 'id' => (int)$purchase->make->id, |
|
35 | - 'name' => (string)$purchase->make->name, |
|
34 | + 'id' => (int) $purchase->make->id, |
|
35 | + 'name' => (string) $purchase->make->name, |
|
36 | 36 | ], |
37 | 37 | 'purchased' => [ |
38 | 38 | 'timestamp' => $purchase->date_purchased->getTimestamp(), |
39 | - 'date' => (string)$purchase->date_purchased->toFormattedDateString(), |
|
40 | - 'readable' => (string)$purchase->date_purchased->diffForHumans(), |
|
39 | + 'date' => (string) $purchase->date_purchased->toFormattedDateString(), |
|
40 | + 'readable' => (string) $purchase->date_purchased->diffForHumans(), |
|
41 | 41 | ], |
42 | 42 | 'delivery' => [ |
43 | 43 | 'timestamp' => $purchase->delivery_date->getTimestamp(), |
44 | - 'date' => (string)$purchase->delivery_date->toFormattedDateString(), |
|
45 | - 'readable' => (string)$purchase->delivery_date->diffForHumans(), |
|
44 | + 'date' => (string) $purchase->delivery_date->toFormattedDateString(), |
|
45 | + 'readable' => (string) $purchase->delivery_date->diffForHumans(), |
|
46 | 46 | ], |
47 | - 'status' => (string)$purchase->status, |
|
47 | + 'status' => (string) $purchase->status, |
|
48 | 48 | ]; |
49 | 49 | } |
50 | 50 |
@@ -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 | } |