@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->validate($request, $this->rules($request->input('supplier_id'))); |
40 | 40 | $purchase = $this->getSupplier($request)->makePurchase( |
41 | - $request->only(['id', 'make_id', 'quantity', 'price', 'date_purchased', 'delivery_date']) |
|
41 | + $request->only([ 'id', 'make_id', 'quantity', 'price', 'date_purchased', 'delivery_date' ]) |
|
42 | 42 | ); |
43 | 43 | event(new PurchaseWasCreated($purchase)); |
44 | 44 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'supplier.location' => 'required_if:supplier_id,new|string|max:255' |
76 | 76 | ]; |
77 | 77 | if ($supplierId != 'new') { |
78 | - $rules += ['supplier_id' => 'required|integer|exists:suppliers,id']; |
|
78 | + $rules += [ 'supplier_id' => 'required|integer|exists:suppliers,id' ]; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return $rules; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | 'name' => 'required|string|max:255' |
39 | 39 | ]); |
40 | 40 | |
41 | - $make = Make::create($request->only(['name'])); |
|
41 | + $make = Make::create($request->only([ 'name' ])); |
|
42 | 42 | event(new MakeWasCreated($make)); |
43 | 43 | } |
44 | 44 |
@@ -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 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'location' => 'required|string|max:255', |
40 | 40 | ]); |
41 | 41 | |
42 | - $supplier = Supplier::create($request->only(['name', 'location'])); |
|
42 | + $supplier = Supplier::create($request->only([ 'name', 'location' ])); |
|
43 | 43 | event(new SupplierWasCreated($supplier)); |
44 | 44 | } |
45 | 45 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @var array |
13 | 13 | */ |
14 | - protected $guarded = []; |
|
14 | + protected $guarded = [ ]; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
@@ -47,6 +47,6 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function dismiss() |
49 | 49 | { |
50 | - return $this->update(['dismissed' => true]); |
|
50 | + return $this->update([ 'dismissed' => true ]); |
|
51 | 51 | } |
52 | 52 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @param Guitar $guitar |
58 | 58 | * |
59 | - * @return \League\Fractal\Resource\Collection |
|
59 | + * @return \League\Fractal\Resource\Item |
|
60 | 60 | */ |
61 | 61 | public function includePurchase(Guitar $guitar) |
62 | 62 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param Guitar $guitar |
70 | 70 | * |
71 | - * @return \League\Fractal\Resource\Collection |
|
71 | + * @return \League\Fractal\Resource\Item |
|
72 | 72 | */ |
73 | 73 | public function includeSale(Guitar $guitar) |
74 | 74 | { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @var array |
14 | 14 | */ |
15 | - protected $availableIncludes = ['purchase', 'sale']; |
|
15 | + protected $availableIncludes = [ 'purchase', 'sale' ]; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Turn this item object into a generic array. |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | 'capacity' => $guitar->rack->capacity, |
45 | 45 | ], |
46 | 46 | 'colour' => $guitar->colour, |
47 | - 'price' => (float)$guitar->price, |
|
48 | - 'damaged' => (bool)$guitar->damaged, |
|
47 | + 'price' => (float) $guitar->price, |
|
48 | + 'damaged' => (bool) $guitar->damaged, |
|
49 | 49 | 'condition' => $guitar->condition, |
50 | - 'sold' => (bool)$guitar->isSold(), |
|
50 | + 'sold' => (bool) $guitar->isSold(), |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $purchase = Purchase::findOrFail($id); |
41 | 41 | |
42 | 42 | return fractal()->item($purchase, new PurchaseTransformer) |
43 | - ->parseIncludes(['guitars', 'supplier']) |
|
43 | + ->parseIncludes([ 'guitars', 'supplier' ]) |
|
44 | 44 | ->toArray(); |
45 | 45 | } |
46 | 46 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @var array |
14 | 14 | */ |
15 | 15 | protected $commands = [ |
16 | - Commands\Init::class, |
|
16 | + Commands\Init::class, |
|
17 | 17 | ]; |
18 | 18 | |
19 | 19 | /** |
@@ -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 | } |