@@ -18,7 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @var array |
20 | 20 | */ |
21 | - protected $guarded = []; |
|
21 | + protected $guarded = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Models of this make. |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @var array |
20 | 20 | */ |
21 | - protected $guarded = []; |
|
21 | + protected $guarded = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Sold guitars. |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function isSold() |
102 | 102 | { |
103 | - return ! is_null($this->sale); |
|
103 | + return !is_null($this->sale); |
|
104 | 104 | } |
105 | 105 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * |
42 | 42 | * @param Rack $rack |
43 | 43 | * |
44 | - * @return \League\Fractal\Resource\Collection |
|
44 | + * @return \League\Fractal\Resource\Item |
|
45 | 45 | */ |
46 | 46 | public function includeWarehouse(Rack $rack) |
47 | 47 | { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['supplier']; |
|
15 | + protected $availableIncludes = [ 'supplier' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -24,25 +24,25 @@ 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, |
|
27 | + 'id' => (int) $purchase->id, |
|
28 | + 'supplier_id' => (int) $purchase->supplier_id, |
|
29 | + 'quantity' => (int) $purchase->quantity, |
|
30 | + 'price' => (float) $purchase->price, |
|
31 | 31 | 'make' => [ |
32 | - 'id' => (int)$purchase->make->id, |
|
33 | - 'name' => (string)$purchase->make->name, |
|
32 | + 'id' => (int) $purchase->make->id, |
|
33 | + 'name' => (string) $purchase->make->name, |
|
34 | 34 | ], |
35 | 35 | 'purchased' => [ |
36 | 36 | 'timestamp' => $purchase->date_purchased->getTimestamp(), |
37 | - 'date' => (string)$purchase->date_purchased->toFormattedDateString(), |
|
38 | - 'readable' => (string)$purchase->date_purchased->diffForHumans(), |
|
37 | + 'date' => (string) $purchase->date_purchased->toFormattedDateString(), |
|
38 | + 'readable' => (string) $purchase->date_purchased->diffForHumans(), |
|
39 | 39 | ], |
40 | 40 | 'delivery' => [ |
41 | 41 | 'timestamp' => $purchase->delivery_date->getTimestamp(), |
42 | - 'date' => (string)$purchase->delivery_date->toFormattedDateString(), |
|
43 | - 'readable' => (string)$purchase->delivery_date->diffForHumans(), |
|
42 | + 'date' => (string) $purchase->delivery_date->toFormattedDateString(), |
|
43 | + 'readable' => (string) $purchase->delivery_date->diffForHumans(), |
|
44 | 44 | ], |
45 | - 'status' => (string)$purchase->status, |
|
45 | + 'status' => (string) $purchase->status, |
|
46 | 46 | ]; |
47 | 47 | } |
48 | 48 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @var array |
20 | 20 | */ |
21 | - protected $guarded = []; |
|
21 | + protected $guarded = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Models of this make. |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @var array |
20 | 20 | */ |
21 | - protected $guarded = []; |
|
21 | + protected $guarded = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Models of this make. |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @var array |
20 | 20 | */ |
21 | - protected $guarded = []; |
|
21 | + protected $guarded = [ ]; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Models of this make. |
@@ -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(); |
@@ -14,13 +14,13 @@ |
||
14 | 14 | */ |
15 | 15 | public function register() |
16 | 16 | { |
17 | - $this->app->bind('fractal', function () { |
|
17 | + $this->app->bind('fractal', function() { |
|
18 | 18 | |
19 | 19 | $manager = new Manager(); |
20 | 20 | |
21 | 21 | $fractal = new Fractal($manager); |
22 | 22 | $fractal->serializeWith(new DataSerializer); |
23 | - $fractal->parseIncludes(request('include', [])); |
|
23 | + $fractal->parseIncludes(request('include', [ ])); |
|
24 | 24 | |
25 | 25 | return $fractal; |
26 | 26 | }); |
@@ -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 | } |